asf icon indicating copy to clipboard operation
asf copied to clipboard

Create example

Open 18615716991 opened this issue 4 years ago • 0 comments

├── config │ └── config.php ├── library │ └── Library.php ├── modules │ ├── api │ │ ├── daos │ │ │ └── Index.php │ │ ├── logics │ │ │ └── Index.php │ │ └── services │ │ └── Index.php │ ├── Bootstrap.php │ └── Constants.php └── public └── index.php 配置文件, 入口文件 支持三种配置文件模式 ini文件 、 php文件 、 PHP变量array

采用 PHP变量 配置, 在入口页直接配置完成

array( 'root_path' => dirname(__DIR__) . '/modules', ) ); $handle = new Asf_Application($configs); $handle->run(); 采用 php文件 配置, 文件后缀名称必须小写 run(); /* config/config.php */ $configs = array( 'asf' => array( 'root_path' => APP_PATH . '/modules', ) ); return $configs; 采用 ini文件 配置, 文件后缀名称必须小写 run(); /* config/config.ini */ [asf] root_path="/path/box3.cn/" 入口文件, 开启命名空间 (推荐开发方式) 请在php.ini文件中配置才生效, asf.use_namespace = On 如果未启用命名空间(默认关闭), 请跳过这步 run(); 通过浏览器访问 http://www.your-domain.com/index.php 浏览器显示结果 ini_set('asf.ctype_id', 5) (default) { "errno": 0, "data": "" } ini_set('asf.ctype_id', 1) { "errno": 0, "errmsg": "", "data": "" }

18615716991 avatar Apr 10 '20 23:04 18615716991