Asf_Loader::Logic

(Asf > 2.1.8)

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

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


Description

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

Examples

Example #1

<?php
use Asf\Loader;

class IndexLogic
{
    public $user;

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

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

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