GithubHelp home page GithubHelp logo

damasdev / codeigniter Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 3.58 MB

Better Codeigniter 3.1 Starter Kit

Home Page: https://github.com/damasdev/codeigniter

PHP 82.63% Twig 13.41% Shell 0.06% JavaScript 3.90%
dotenv twig bootstrap4 codeigniter3 datatables hmvc jwt

codeigniter's Introduction

Codeigniter

Codeigniter Framework

Folder Structure

codeigniter/
├── modules/
│   ├── auth
│   ├── home
├── public/
│   ├── .htaccess
│   └── index.php
├── src/
├── vendor/
│   └── codeigniter/
│       └── framework/
│           └── system/
├── composer.json

Application

To create MVC stack (controller, model, view) you can use create:app.

Usage example

// Create an MVC stack
composer run-script matches create:app users

// Create an MVC stack inside admin module
composer run-script matches create:app admin.users

Controllers

create:controller name_of_controller

You can use Matches to create a Controller file. The command will need at leas a parameter which represents the name of the controller.

You can put the controller inside a module. Directories are delimited with ".". So, if you want to create the controller inside modules/admin/controllers, you can do create:controller admin.name_of_controller.

Usage examples

// Create a Welcome controller
composer run-script matches create:controller welcome

// Create a User controller inside admin module
composer run-script matches create:controller admin.user

Models

create:model name_of_model

Creates a model having name_of_model as name. You can put the model inside a module. Directories are delimited with ".". So, if you want to create the model inside modules/admin/models, you can do create model admin.name_of_model.

Usage examples

// Create a user model
composer run-script matches create:model user

// Create a User model inside admin module
composer run-script matches create:model admin.user

Views

create:view name_of_view

Creates a view having name_of_view as file name. You can put the view inside a module. Directories are delimited with ".". So, if you want to create the view inside modules/admin/views, you can do create view admin.name_of_view.

Usage examples

// Create an index_view.php
composer run-script matches create:view user_view

// Create an index_view.php inside users module
composer run-script matches create:view users.index_view

Migrations

CodeIgniter Matches helps you create, do, undo, and reset migrations.

create:migration

To create a migration you can call create:migration. As a result, a migration will be created in the migrations directory prefixed with version as file name. You can also pass a table name as parameter. If no table name is given, you will have to put the name of the table in the migration file. Below are usage examples:

Usage examples

// Create a migration
composer run-script matches create:migration create_users_table

// Create a migration with a table inside it
composer run-script matches create:migration create_users_table table:users

// Create a migration with a table inside it
composer run-script matches create:migration create_users_table t:users

do:migration

do:migration executes the migrations' up() methods. If you pass the version of the migration a parameter, it will stop at that version of the migration.

Usage examples:

// Execute all migrations until the last one
composer run-script matches do:migration

// Execute all migrations until a certain version of migration
composer run-script matches do:migration 20150722

undo:migration

undo:migration returns you to the previous migration version. This one also can accept a migration version as parameter to return to a migration.

Usage examples:

// Undo last migration
composer run-script matches undo:migration

// Undo the migrations until a specified migration version
composer run-script matches undo:migration 20150722

reset:migration

reset:migration will reset the migrations until the migration mentioned in $config['migration_version'] (in the migration configuration file).

Usage example:

// Reset the migrations
composer run-script matches reset:migration

codeigniter's People

Contributors

damasdev avatar dependabot[bot] avatar stylecibot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.