Skip to content

maulikgushani/Codeigniter4-Command

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 

Repository files navigation

Codeigniter4-Command

Create controller, model, view using spark command in codeigniter 4.

How to use?

Step-1: Download or clone this repo.
Step-2 : Open codeigniter4 project.
Step-3 : Copy library app/Commands folder and paste into your codeigniter project app directory.
Step-4 : Copy library writable/mgdemofiles folder and paste into your codeigniter project writable directory.
Step-5 : Now you can used command and generate Controllers and Models in codeigniter4.

How to create controller?

Open terminal or cmd promt and fire below command:
php spark make:controller ControllerName

php spark make:controller ProductController

For more help fire
php spark help make:controller

How to create model?

Open terminal or cmd promt and fire below command:
php spark make:model Modelname

php spark make:model ProductModel
When fire this command the table name is by default taken as product_model.

If you want use custom table name then fire below command:
php spark make:model ProductModel table=products

By default primary key is id if you want use custom then use primary keyword like below:
php spark make:model ProductModel primary=tid

For more help fire
php spark help make:model

How to get a list of registered route?

Open terminal or cmd promt and fire below command.
php spark route:list

For specific types of methods you can pass methods name param as below:
php spark route:list methods=get,post,put

For more help fire
php spark help route:list

About

Create controller, model, view using command in codeigniter 4.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages