Skip to content

Quickly creating development customize template cli.

License

Notifications You must be signed in to change notification settings

FelixLinBH/Centimani

Repository files navigation

Centimani

Quickly creating development customize tmpelate cli

NPM

Install

If you haven't already got Node.js, then go get it.

npm install centimani -g

Features

  • Customize template what you want.
  • Provide cli instruction from setting json.

Introduction

Using init instruction

1.Creating setting.json file, writing folder structure.

$ centimani init

Example Setting.json

{
    "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!

Example controllerTemplInjection.php

<?php
class {{class_name}}
{
    
}

Creating test.php as below

<?php
class test
{
    
}

Templates use mustache, use {{class_name}} replace name.

Example controllerTemplInjection.php

It`s also appending template code.

Route::get('/', '{{class_name}}@show');

Appending to controller.php as below

Route::get('/', 'test@show');

Screenshots

Sample

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Quickly creating development customize template cli.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published