This extension enables the creation of CodeIgniter Modules, making your application modular - Hierarchical Model View Controller (HMVC).
All modules are packed in their own directory, with their own individual files;
- Configs,
- Controllers,
- Database,
- Entities,
- Filters,
- Languages,
- Libraries,
- Models,
- Validation,
- Views, etc.
This allows code reusability and easy distribution of modules across other CodeIgniter applications.
Download the file from GitHub and place them into the app/Commands
folders in the application directory.
This extension is a CLI
tool, as such all operations are carried out using Commands.
Note: replace the module
name Example
and other sample data in the commands below.
Generates a new Module.
Usage: module:make [name]
php spark module:make Example
Delete a module.
Usage: module:delete [module]
php spark module:delete Example
Generates a new Route file.
Usage: module:route [module]
php spark module:route Example
Generates a new Controller file.
Usage: module:controller [name] [module]
php spark module:controller ExampleController Example
Generates a new migration file.
Usage: module:migration [name] [module]
php spark module:migration CreateExamplesTable Example
php spark module:migration create_examples_table Example
Migrate a Module migration files.
Usage: module:migrate [module]
php spark module:migrate Example
Generates a new Module seeder file.
Usage: module:seeder [name] [module]
php spark module:seeder Example Example
php spark module:seeder ExampleSeeder Example
Run a db:seed command in a Module.
Usage: module:seed [module] [seeder]
php spark module:seed Example
php spark module:seed Example ExampleSeeder
Generates a new module Entity class.
Usage: module:entity [name] [module]
php spark module:entity Example Example
Generates a new module Model file.
Usage: module:model [name] [module]
php spark module:model ExampleModel Example