Giter VIP home page Giter VIP logo

base-codeigniter-app's Introduction

Build Status

Base CodeIgniter App

A starting point CodeIgniter App filled with useful goodies.

Setup

  1. Clone or download
  2. Set the following directories to writable:
    1. application/cache
    2. application/logs
    3. application/db_cache
    4. public/assets/cache

That's it! No submodules because they are a pain.

Usage

  • MY_Controller does a ton of cool stuff:
    • autoload views by saving them as controller_name/method_name.php or define a custom view as $this->view = 'my_view' or skip the view with $this->view = false;
    • views are loaded into layouts (templates) stored in views/layouts. The default layout is application.php. You can change it inside a controller method with $layout = 'layout_name'. or skip the layout with $layout = false;
    • autoload models by saving them as controller_name_model.php. It gets loaded as $this->controller_name.
    • filters are functions run before and after controller output. Set them via public $before_filters = array('method_1', 'method_2');. They take the same params that your controller method does. The point is that you can run them for all but certain methods, only certain methods, or a mix between. Great for authentication!
    • auto migrate to latest version. To enable, uncomment $this->_migrate(); in application/core/MY_Controller.php
  • MY_Model lets you greatly reduce necessary model methods, allow validation in the model, enable observers. Check out the source for details, there's too much to explain here.
  • Presenters to clean up views dramatically
  • REST_Controller to authenticate, format, and present errors properly
  • Pigeon and API_Router for RESTful routing
  • Updated MY_Migration. You can set the migration table in application/config/migration.php
  • MY_Form_validation for a prefix and suffix for each form error. Set it in application/config/form_validation.php
  • All public stuff such as index.php and assets goes in /public/
  • Add a Composer package by editing /composer.json, then run php composer.phar install on the command line from the root directory.

But wait, there's more!

  • Jamie Rumbelow's REST_Controller to output in various formats, throttle, authenticate, return API manifest, add debug info, etc. Extend it, set $this->data, and you're done! You can also set $this->status_code to a 3-digit number and $this->respond(); to just send a status back
  • caching fragments available via the fragment library, repeating partial views via the partial helper
  • Using MY_Log to fix chmod issues
  • Includes Sparks with the following sparks:
    • assets - for easy combining, minifying, and caching of js/css and parsing LESS and CoffeeScript
    • curl - makes curl codeignitery
    • events - event-driven development
    • query string helper - makes working with query-string heavy apps much easier
    • REST client - to interact with RESTful APIs
  • Includes Kenji's CIUnit for unit testing of models, controllers, helpers, libraries. Unit test examples are in tests/folder_name. There is a working controller test in tests/controllers/welcome_Test.php
  • Twitter Bootstrap for easy, responsive, beautiful, customizable, cross-browser UI goodness.
  • API exception handler and manifest library to return formatted API help (both in application/libraries/api)
  • .htaccess from HTML5 Boilerplate with CodeIgniter stuff to remove index.php
  • main config and database config are separated into folders for four typical development environments. I usually add environment setting logic based on the HTTP_HOST in index.php.
  • Includes FirePHP

Change Log

2.0.1

  • Added FirePHP library
  • Added example for Selenium functional test thanks to Phil Palmieri's examples
  • Added examples for model, helper, and library tests
  • Updated Twitter Bootstrap to 2.2.0
  • Show profiler by default if in development environment and it's not an ajax request
  • Added autoload sparks line
  • Better gitignore

2.0.0

  • Added most things above. No need to repeat the entire README again :) .

1.1.2

  • Updated submodules

1.1.1

  • Updated Twitter Bootstrap to 2.0.2
  • Removed copyright statements from docblocks
  • Updated all relevant docblocks to @version 1.1.2

1.1.0

  • Support for travis-ci
  • Updated db config

base-codeigniter-app's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

base-codeigniter-app's Issues

Short tags

Mike,

Just an FYI, from php.ini regarding short tags:

; This directive determines whether or not PHP will recognize code between
; tags as PHP source which should be processed as such. It's been
; recommended for several years that you not use the short tag "short cut" and
; instead to use the full tag combination. With the wide spread use
; of XML and use of these tags by other languages, the server can become easily
; confused and end up parsing the wrong code in the wrong context. But because
; this short cut has been a feature for such a long time, it's currently still
; supported for backwards compatibility, but we recommend you don't use them.

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.