constants 初始化操作; 方便定义常量错误码、错误内容
可以配合 Asf_Ensure 使用
public Asf_Application Asf_Application::constants(void)
此函数没有参数
返回一个对象 Asf_Application object
<?php
class IndexService
{
public function indexAction()
{
return Constants::ERR_INDEX_SUCCESS;
}
}
class Constants
{
const ERR_INDEX_SUCCESS = 'hello world';
}
$configs = array(
'asf' => array(
'root_path' => MODULE_PATH,
)
);
$handle = new Asf_Application($configs);
$handle->constants()->run();