Application (Business process)
In this layer, you can design your business process as concepts. Just use the APIs of Service, and do not need to care about the service implementation. Also it communicates with Front-end, getting request from user's action.
Service (Service provider)
As service providers, here processes the request from Application layer. And implement functions and use the data manager from Storage layer to process data.
Storage (Data manager)
Data entities will store here.
System (Infrastructure)
Basic functions, utilities, runtime and router.
php >= 5.6
composer installEasy to bind a route url path to defined Action, support sign :id as parameter pass into Action
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
}
//...
}Easy render template
<p>{title}</p>class Home extends Action implements ActionInterface
{
public function index()
{
$replaces = [
'title' => 'Siegelion demo'
];
return $this->render('home.html', $replaces);
}
}Tech Stack
Initial Setting
npm init
npm startEnjoy your coding
Copyright (c) 2016 Wei Li ([email protected]) MIT Licence