sephy framework
1.0.0
一個簡單的PHP框架,使用Symfony的MVC結構和組件並照明。
Sephy支持的一些功能:
如果您有任何好主意,請隨時提交拉動請求,尚未實施許多功能!
立即開始!
git clone https://github.com/adrielov/sephy-framework.git
cd sephy-framework
composer install
Blade是帶有Laravel的簡單而功能強大的模板引擎。與其他流行的PHP模板引擎不同,Blade不限於您在視圖中使用普通PHP代碼。
class HomeController extends Controller
{
public function index() {
$this->params['title'] = "Sephy Simple PHP Framework";
$this->view('home.index',$this->params);
}
}
在應用程序/config.php中配置您的路由
$router->add('/', 'HomeController::index');
$router->get('/profile', 'UserController::profile');
$router->get('/profile/{id}', 'UserController::profile',[
'id' => '[0-9]'
]);
前綴組屬性可用於以給定的URI(例如 /dashboard /home)在組中的每個路線前綴
$router->prefix('dashboard', function (CoreRouter $router) {
$router->add('/home', 'DashboardController::index');
$router->add('/config', 'DashboardController::config');
});
中間件是您路線的過濾器,通常用於修改或認證請求。
$router->group(['middleware' => ['auth']], function (CoreRouter $router) {
$router->add('/profile', 'UserController::profile');
});