Asf_Loader::Dao

(Asf > 2.1.8)

只获取Dao层类的单例, 可以理解为 new 一个Dao层类(new ClassnameDao)

其它加载规则如同 Asf_Loader::get


Description

public static object Asf_Loader::dao(string $class_name [, string $module_name = ''])

Examples

Example #1

<?php
use Asf\Loader;

class IndexDao
{
    public $user;

    public function __construct()
    {/*{{{*/
        $this->user = 'zhangsan';
    }/*}}}*/

    public function getUser()
    {/*{{{*/
        return $this->user;
    }/*}}}*/
}

class IndexService
{
    public function indexAction()
    {/*{{{*/
        return Loader::dao('Index')->getUser();
        //return Loader::get('IndexDao')->getUser();
    }/*}}}*/
}