sikamy / sephy-framework
此包的最新版本(dev-analysis-8APM1l)没有可用的许可证信息。
简单的PHP框架
dev-analysis-8APM1l
2016-07-19 17:42 UTC
Requires
- illuminate/cache: 5.1.*
- illuminate/database: 5.1.*
- illuminate/events: 5.1.*
- illuminate/http: 5.1.*
- illuminate/pagination: 5.1.*
- illuminate/session: 5.1.*
- illuminate/support: 5.1.*
- illuminate/view: 5.1.*
- nesbot/carbon: ^1.21
- php-di/php-di: 5.1.*
- swiftmailer/swiftmailer: ^5.4
- symfony/routing: ^3.0
- twig/twig: ~1.0
- windwalker/renderer: ^2.1
This package is not auto-updated.
Last update: 2024-09-20 18:03:16 UTC
README
一个使用MVC结构和Symfony、Illuminate组件的简单PHP框架。
Sephy支持的一些功能
- 路由
- 中间件(路由特定中间件和全局中间件)
- Eloquent ORM
- 带有Blade和Twig模板引擎的视图
- 使用内置邮件类轻松发送邮件!
- 用于简化会话使用的会话驱动程序。
还有很多功能尚未实现,如果您有任何好主意,请随时提交拉取请求!
现在开始!
git clone https://github.com/adrielov/sephy-framework.git
cd sephy-framework
composer install
控制器 & 视图(Blade)
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);
}
}
路由
在App/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 (Core\Router $router) {
$router->add('/home', 'DashboardController::index');
$router->add('/config', 'DashboardController::config');
});
路由分组 & 中间件
中间件是路由的过滤器,通常用于修改或验证请求。
$router->group(['middleware' => ['auth']], function (Core\Router $router) {
$router->add('/profile', 'UserController::profile');
});
作者
- Adriel Oliveira (Github) Sephy的创建者。