可以创建多个项目(Project),共用TimoPHP框架(Framework),每个项目可以有多个应用(Application),推荐项目和框架在同一个目录下,当然,可以自定义目录结构
/wwwroot/
|--project_1
|--TimoNode
|--TimoPHP
|--TimoSNS
|--project_n
在命令行执行
php TimoPHP\bin\timo -c project_name app_name app_type
project_name 为你要创建项目的名称,如golivy
app_name 应用名称,默认为api
app_type 应用类型(web、api),默认api
修改一下配置文件即可使用,不需要的控制器和Model自己删除掉
比如我们创建了一个项目叫 golivy
php TimoPHP\bin\timo -c golivy api
<VirtualHost *:80>
ServerAdmin webmaster@timophp.com
DocumentRoot "E:\wwwroot\golivy\public\api"
ServerName api.govlivy.dev
ErrorLog "logs/api.govlivy.dev-error.log"
CustomLog "logs/api.govlivy.dev-access.log" common
<Directory "E:\wwwroot\golivy\public\api">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
127.0.0.1 api.govlivy.dev
http://api.govlivy.dev/
<VirtualHost *:8090>
ServerAdmin webmaster@timophp.com
DocumentRoot "E:\wwwroot\golivy\public\api"
ServerName localhost
ErrorLog "logs/api.govlivy.dev-error.log"
CustomLog "logs/api.govlivy.dev-access.log" common
<Directory "E:\wwwroot\golivy\public\api">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#Listen 12.34.56.78:80
Listen 80
Listen 8090
http://127.0.0.1:8090
上面的访问都是访问到Index控制的index方法
http://域名/控制器/动作[后缀]/[参数]/[参数]/?param1=value1
http://www.timophp.com/document/show/129/
http://www.timophp.com/doc/1008/?type=1&flag=2