Skip to content

Create example#1

Open
18615716991 wants to merge 1 commit into
yulonghu:masterfrom
18615716991:patch-1
Open

Create example#1
18615716991 wants to merge 1 commit into
yulonghu:masterfrom
18615716991:patch-1

Conversation

@18615716991

Copy link
Copy Markdown

├── 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": "" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant