定制 jfm/simple-mvc-route-attributes-package 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jfm/simple-mvc-route-attributes-package

最新稳定版本:v1.0.1

Composer 安装命令:

composer require jfm/simple-mvc-route-attributes-package

包简介

A little package for the pedagogical PHP MVC framework owned by Wild Code School. Used for educational purpose only

README 文档

README

Description

This package is for the Wild Code School Simple MVC project. It allows to add attributes on all the Controller methods to define the route.

Installation

composer require jfm/simple-mvc-route-attributes

After the installation, you need to replace the all content of the src/routing.php file with the following:

<?php

use Jfm\SimpleMvcRouteAttributesPackage\Routing\RouteLoader;

RouteLoader::getInstance()->loadRoutes();

Usage

You can now use the #[Route] attribute on all your Controller methods to define the route.

<?php

namespace App\Controller;

use JFM\SimpleMVCRouteAttributes\Route;

class HomeController extends AbstractController
{
    #[Route('/')]
    public function index()
    {
        // ...
    }
// ...
}
<?php

namespace App\Controller;

use JFM\SimpleMVCRouteAttributes\Route;

class ItemController extends AbstractController
{
    #[Route('/items')]
    public function index()
    {
        // ...
    }

    #[Route('/items/show')]
    public function show()
    {
        // ...
    }
// ...
}

That's it!

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固