Giter Site home page Giter Site logo

cli-codeigniter3's Introduction

Simple Cli CodeIgniter 3

A simple command line interface for the framework CodeIgniter 3.

Features

  • Create Controller
  • Create Model
  • Create Migration (sequential or timestamp)
  • Run Migration

Installation

First! Download and copy the scli file to the project root developed with CodeIgniter 3. Done! Simple, right?

Creating Controller

$ php scli controller name_your_controller

or

$ php scli c name_your_controller

Creating Model

$ php scli model name_your_model

or

$ php scli m name_your_model

Creating Controller and Model

$ php scli cm name

Creating Migration

Parameters:

  • t: Set timestamp mode (default)
  • s: Set sequential mode
  • []: Table Attributes
$ php scli mi create_tbl_customers

or

$ php scli migration create_tbl_customers

result: 20161127161159_create_tbl_customers.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Create_tbl_customers extends CI_Migration {
   public function up()
   {
   }
   public function down()
   {
   }
}

Using sequential format and using attributes

$ php scli mi s create_tbl_customers [id,name,phone,address]

result: 001_create_tbl_customers.php

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Create_tbl_customers extends CI_Migration {
   public function up()
   {
        $this->dbforge->add_field(array(
            'id' => array(),
            'name' => array(),
            'phone' => array(),
            'address' => array()
        ));

        $this->dbforge->add_key('id', TRUE);
        $this->dbforge->create_table('YOUR_TABLE');
   }

   public function down()
   {
        $this->dbforge->drop_table('YOUR_TABLE', TRUE);
   }
}

Running Migration

Run last migration

$ php scli migrate

or

$ php scli do:migrate

Run a specific version of the migration

$ php scli migrate value (sequential or timestamp)

or

$ php scli do:migrate value (sequential or timestamp)

License

Licensed under the MIT License.

cli-codeigniter3's People

Contributors

ronaldaraujo avatar ball6847 avatar rafa-acioly avatar

Watchers

 avatar  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.