PHPackages                             ci4-cms-erp/ext\_module\_generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. ci4-cms-erp/ext\_module\_generator

ActiveLibrary[CLI &amp; Console](/categories/cli)

ci4-cms-erp/ext\_module\_generator
==================================

A Spark command for CodeIgniter 4 that generates a modular structure for the ci4ms framework, including controllers, views, routes, and language files.

v1.2.4(4mo ago)21.8k1MITPHPPHP ^8.1CI passing

Since Sep 13Pushed 4mo agoCompare

[ Source](https://github.com/ci4-cms-erp/ext_module_generator)[ Packagist](https://packagist.org/packages/ci4-cms-erp/ext_module_generator)[ Docs](https://github.com/ci4-cms-erp/ext_module_generator)[ RSS](/packages/ci4-cms-erp-ext-module-generator/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (12)Used By (1)

CodeIgniter 4 Module Generator
==============================

[](#codeigniter-4-module-generator)

A powerful CLI tool for generating modular structures in CodeIgniter 4 applications, specifically designed for the ci4ms framework. The `ModuleGenerator` simplifies the creation of standardized module structures, including configuration files, controllers, views, and language files.

Overview
--------

[](#overview)

The `ModuleGenerator` is a CodeIgniter 4 CLI command that creates a complete module structure with a single command. It follows CodeIgniter 4 conventions and best practices, making it an essential tool for developers building modular applications with the ci4ms framework.

### Key Features

[](#key-features)

- Generates a complete module structure with a single CLI command
- Creates configuration, routes, controllers, views, and language files
- Supports English and Turkish language files by default
- Seamlessly integrates with CodeIgniter's CLI
- Customizable templates for flexibility
- Ensures consistent module structure across projects

Installation
------------

[](#installation)

To use the `ModuleGenerator`, install it via Composer:

```
composer require ci4-cms-erp/ext_module_generator
```

Usage
-----

[](#usage)

Run the following command in your CodeIgniter 4 project directory to create a new module:

```
php spark make:module ModuleName
```

If no module name is provided, the CLI will prompt you to enter one. The module name will be automatically capitalized (e.g., `user` becomes `User`).

### Example

[](#example)

```
$ php spark make:module Admin
Module 'Admin' created successfully!

$ php spark make:module Blog
Module 'Blog' created successfully!
```

This will generate modules named `Admin` and `Blog` in the `modules` directory with all necessary files and folders.

Generated Module Structure
--------------------------

[](#generated-module-structure)

The `ModuleGenerator` creates the following directory structure for each module:

```
modules/ModuleName/
├── Config/
│   ├── ModuleNameConfig.php
│   └── Routes.php
├── Controllers/
│   └── ModuleName.php
├── Database/
│   ├── Migrations/
│   └── Seeds/
├── Helpers/
├── Language/
│   ├── en/
│   │   └── ModuleName.php
│   └── tr/
│       └── ModuleName.php
├── Libraries/
├── Models/
├── Validation/
└── Views/
    ├── create.php
    ├── list.php
    └── update.php

```

Each directory and file serves a specific purpose, adhering to CodeIgniter 4 conventions.

Generated Files
---------------

[](#generated-files)

The generator creates the following template files with predefined content:

- **Config/ModuleNameConfig.php**: Defines module-specific configurations, including CSRF exceptions and filters.
- **Config/Routes.php**: Sets up routes for the module, including index, create, update, and delete routes.
- **Controllers/ModuleName.php**: A controller with methods for index, create, update, and delete actions, including basic validation.
- **Language Files**: English (`en/ModuleName.php`) and Turkish (`tr/ModuleName.php`) language files with welcome messages.
- **Views**: Templates for `create.php`, `list.php`, and `update.php` views, integrated with a base layout.

### Example Controller

[](#example-controller)

Below is an example of the generated controller for a module named `Blog`:

```
namespace Modules\Blog\Controllers;

class Blog extends \Modules\Backend\Controllers\BaseController {
    public function index() {
        return view('Modules\Blog\Views\list', $this->defData);
    }

    public function create() {
        if ($this->request->is('post')) {
            $vdata = [
                ''=>['label'=>'', 'rules'=>''],
            ];
            $valData = ($vdata);
            if ($this->validate($valData) == false) return redirect()->back()->withInput()->with('errors', $this->validator->getErrors());
        }
        return view('Modules\Blog\Views\create', $this->defData);
    }

    public function update(int $id) {
        if ($this->request->is('post')) {
            $vdata = [
                ''=>['label'=>'', 'rules'=>''],
            ];
            $valData = ($vdata);
            if ($this->validate($valData) == false) return redirect()->back()->withInput()->with('errors', $this->validator->getErrors());
        }
        return view('Modules\Blog\Views\update', $this->defData);
    }

    public function delete(int $id)
    {
        $infos=$this->commonModel->selectOne('your_table',['id'=>$id]);
        if($this->commonModel->remove('your_table',['id'=>$id]))
            return $this->redirect()->back()->with('success',$infos->attr.' deleted.');
        return $this->redirect()->back()->with('error','Can not deleted.');
    }
}
```

Customization
-------------

[](#customization)

The `ModuleGenerator` uses template methods to generate files, allowing developers to customize the templates in the `ModuleGenerator.php` class to fit specific project requirements.

Requirements
------------

[](#requirements)

- CodeIgniter 4
- PHP 7.4 or higher
- Composer for installation

License
-------

[](#license)

This project is licensed under the MIT License.

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit a pull request or open an issue on the project's GitHub repository.

Support
-------

[](#support)

For issues or questions, refer to the GitHub repository or contact the maintainers.

---

Made with ❤️ for the CodeIgniter community
© 2025 - All rights reserved

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance74

Regular maintenance activity

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~48 days

Total

11

Last Release

140d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20905215?v=4)[Bertuğ Fahri ÖZER](/maintainers/bertugfahriozer)[@bertugfahriozer](https://github.com/bertugfahriozer)

---

Top Contributors

[![bertugfahriozer](https://avatars.githubusercontent.com/u/20905215?v=4)](https://github.com/bertugfahriozer "bertugfahriozer (14 commits)")

---

Tags

ci4mscli-toolcodeigniter4crud-generatorgeneratormodularmodulephpphp-libraryscaffoldsparkspark-commandsmodulesparkcodeigniter4module generatorci4ms

### Embed Badge

![Health badge](/badges/ci4-cms-erp-ext-module-generator/health.svg)

```
[![Health](https://phpackages.com/badges/ci4-cms-erp-ext-module-generator/health.svg)](https://phpackages.com/packages/ci4-cms-erp-ext-module-generator)
```

###  Alternatives

[olegkoval/magento2-regenerate-url-rewrites

Add into Magento 2 a CLI feature which allow to regenerate a Url Rewrites of products and categories

4444.0M2](/packages/olegkoval-magento2-regenerate-url-rewrites)[abydahana/aksara

Aksara is a modern, developer-friendly framework and CMS built on CodeIgniter 4, featuring rapid CRUD development, modular architecture, smart routing, flexible access control, API integration, and an AI assistant to make content management faster and smarter.

1141.2k](/packages/abydahana-aksara)[maniaba/asset-connect

AssetConnect is a file management library for CodeIgniter 4 that allows you to associate files with any entity in your application

1016.0k](/packages/maniaba-asset-connect)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
