mathec-x / compiler
php-js-css 套件和结构
dev-master
2020-12-23 20:45 UTC
Requires
- php: >=7.0.0
This package is auto-updated.
Last update: 2024-09-24 05:36:03 UTC
README
php-js-css 套件和结构
所有路由都将尊重控制器的顺序,只需在 public/index.php 中添加即可
使用 Compiler\App\Art;
$Art = new Art; $Art->UseMvc();
在 package.json 中
"require": {
"mathec-x/compiler" : "dev-master"
},
所有控制器的名称必须以 'controller' 结尾,遵循命名空间/类/函数的顺序
结构文件夹
工作项目
-
控制器
- 命名空间
- classController.php
- anotherClassController.php
- 命名空间
-
视图
- 命名空间
- classFunction.php
- anotherClassFunction.php
- 命名空间
-
公共
- index.php
app 内部的路由将是 /namespace/class/function
将首字母大写 /namespace/another-class/function
辅助函数
- Json( @array ) : string
- View()
- first()
JavaScript 套件
use Compiler\Minify;
$vendorfile = "public/core/vendor.js";
$rootdir = dirname(__DIR__);
require("$rootdir/vendor/autoload.php");
$libs = new Minify\JS();
$libs->add( $ngRoot . "/static/libs/underscore-min.js");
$libs->cdn("https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js");
//create the file in public
$libs->build($vendorfile);