siegelion
1.0.0
应用程序(业务流程)
在此层中,您可以将业务流程设计为概念。只需使用服务的API即可,而无需关心服务实施即可。它还与前端进行通信,从用户的操作中获取请求。
服务(服务提供商)
作为服务提供商,这里处理应用程序层的请求。并实现功能,并将数据管理器从存储层进行处理数据。
存储(数据经理)
数据实体将存储在这里。
系统(基础架构)
基本功能,实用程序,运行时和路由器。
php >= 5.6
composer install易于绑定路线URL路径到定义的动作,支持标志:id作为参数传递到动作
class App extends AppKernel implements AppInterface
{
public function run ()
{
Router:: setAction ( ' /login ' , ' UserLogin ' );
Router:: setAction ( ' /user/:id ' , ' UserInfo ' );
}
} class UserInfo extends Action implements RestfulActionInterface
{
//[GET] /user/:id
public function get ( $ params , $ query )
{
return $ params [ ' id ' ]; // will echo the content of parameter id from url
}
//...
}简单的渲染模板
< p > {title} </ p > class Home extends Action implements ActionInterface
{
public function index ()
{
$ replaces = [
' title ' => ' Siegelion demo '
];
return $ this -> render ( ' home.html ' , $ replaces );
}
}技术堆栈
初始设置
npm init
npm start享受您的编码
版权(c)2016 wei li([email protected])麻省理工学院许可证