Quickly creating development customize tmpelate cli
If you haven't already got Node.js, then go get it.
npm install centimani -g
- Customize template what you want.
- Provide cli instruction from setting json.
1.Creating setting.json file, writing folder structure.
$ centimani init
{
"controller": [
{
"templates": "./templ/templ.php",
"distPath": "./dist/php/",
"injectionFile": [
{
"templates": "./templ/controllerTemplInjection.php",
"distPath": "./source/controller.php"
},
{
"templates": "./templ/controllerTemplInjection.php",
"distPath": "./source/controller2.php"
}],
"suffix": "php"
},
{
"templates": "./templ/templ.js",
"distPath": "./dist/js/",
"suffix": "js",
"prefix": "page"
},
{
"templates": "./templ/templ.css",
"distPath": "./dist/css/",
"suffix": "css"
}],
"class": [
{
"templates":"./templ/templ2.php",
"distPath":"./dist/php/",
}]
}
There is two instruction help you creating base code with customize template.
$ centimani new controller test
It`s creating test.php at "./dist/php/" path. According to "./templ/controllerTemplInjection.php" which is template file,creating you want!
<?php
class {{class_name}}
{
}
Creating test.php as below
<?php
class test
{
}
Templates use mustache, use {{class_name}} replace name.
It`s also appending template code.
Route::get('/', '{{class_name}}@show');
Appending to controller.php as below
Route::get('/', 'test@show');
- Felix Lin - Github
This project is licensed under the MIT License - see the LICENSE.md file for details