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])麻省理工學院許可證