Create a Controller

Alexey Gordeyev edited this page Jan 19, 2014 · 3 revisions

Back to Documentation

How to create Controller via CLI TrinteJS MVC

Table of contents

Command format

  format: trinte -g controller [controller name] [action(s)]

Create a empty Controller

$ trinte -g controller Post

Create a Controller with actions

$ trinte -g controller User index create edit delete

Generated files, path like that:

    .
    |
    `-- app
        `-- controllers
            |-- PostsController.js
            `-- ...

Create a Controller with namespace and actions

$ trinte -g controller admin#Post index create edit delete

Generated files with namespace, path like that:

    .
    |
    `-- app
        `-- controllers
            `-- admin
                |-- PostsController.js
                `-- ...

Back to Documentation