PHPackages                             slaxweb/ci-basecontroller - 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. slaxweb/ci-basecontroller

ActiveLibrary

slaxweb/ci-basecontroller
=========================

BaseController for CodeIgniter

0.4.1(10y ago)102733[4 issues](https://github.com/slax0rr/BaseController/issues)MITPHPPHP &gt;=5.3.0

Since Aug 20Pushed 10y ago3 watchersCompare

[ Source](https://github.com/slax0rr/BaseController)[ Packagist](https://packagist.org/packages/slaxweb/ci-basecontroller)[ RSS](/packages/slaxweb-ci-basecontroller/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (14)Used By (0)

BaseController
==============

[](#basecontroller)

Base controller for CodeIgniter, helps you with loading views, subviews, and populating them with data and loading of language as well as injecting said languages into the view data.

The idea for the BaseController came from Jamie Rumbelows [base controller](https://github.com/jamierumbelow/codeigniter-base-controller), with some additions and changes. At this point I would also like to thank [Marco Monteiro](https://github.com/mpmont) and [Sami Keinänen](https://github.com/skope) for their help.

If you run into issues or have questions/ideas, please submit a ticket here on [GitHub](https://github.com/slax0rr/BaseController/issues).

This is still in development phase, but is production ready. All existing stuff will be there and if changes do occur, old ways will be kept around in deprecated state.

Table of contents
=================

[](#table-of-contents)

- [BaseController](https://github.com/slax0rr/BaseController/blob/master/README.md#basecontroller)
- [Table of contents](https://github.com/slax0rr/BaseController/blob/master/README.md#table-of-contents)
- [Install](https://github.com/slax0rr/BaseController/blob/master/README.md#install)
- [View loading and data](https://github.com/slax0rr/BaseController/blob/master/README.md#view-loading-and-data)
    - [Example](https://github.com/slax0rr/BaseController/blob/master/README.md#example)
    - [Basic usage](https://github.com/slax0rr/BaseController/blob/master/README.md#basic-usage)
    - [Disable view loading](https://github.com/slax0rr/BaseController/blob/master/README.md#disable-view-loading)
    - [Change view file](https://github.com/slax0rr/BaseController/blob/master/README.md#change-view-file)
    - [Load sub-views](https://github.com/slax0rr/BaseController/blob/master/README.md#load-sub-views)
    - [View data](https://github.com/slax0rr/BaseController/blob/master/README.md#view-data)
    - [Controller 404 page](https://github.com/slax0rr/BaseController/blob/master/README.md#controller-404-page)
- [Languages](https://github.com/slax0rr/BaseController/blob/master/README.md#languages)
    - [Example](https://github.com/slax0rr/BaseController/blob/master/README.md#example-1)
    - [Basic usage](https://github.com/slax0rr/BaseController/blob/master/README.md#basic-usage-1)
    - [No languages](https://github.com/slax0rr/BaseController/blob/master/README.md#no-languages)
    - [Language file](https://github.com/slax0rr/BaseController/blob/master/README.md#language-file)
    - [Language prefix](https://github.com/slax0rr/BaseController/blob/master/README.md#language-prefix)
    - [Non-Default language](https://github.com/slax0rr/BaseController/blob/master/README.md#non-default-language)
- [Templates](https://github.com/slax0rr/BaseController/blob/master/README.md#templates)
    - [Example](https://github.com/slax0rr/BaseController/blob/master/README.md#example-2)
    - [DEPRECATED - Setting template files](https://github.com/slax0rr/BaseController/blob/master/README.md#deprecated---setting-template-files)
    - [DEPRECATED - Disable template](https://github.com/slax0rr/BaseController/blob/master/README.md#deprecated---disable-template)
    - [Layout](https://github.com/slax0rr/BaseController/blob/master/README.md#layout)
- [Manual view loading](https://github.com/slax0rr/BaseController/blob/master/README.md#manual-view-loading)
- [Models](https://github.com/slax0rr/BaseController/blob/master/README.md#models)
    - [Example](https://github.com/slax0rr/BaseController/blob/master/README.md#example-3)
- [CRUD](https://github.com/slax0rr/BaseController/blob/master/README.md#crud)
- [ChangeLog](https://github.com/slax0rr/BaseController/blob/master/README.md#changelog)

Install
=======

[](#install)

The easiest way to install at the moment is to use [composer](https://getcomposer.org/). Simply create composer.json file in your project root:

```
{
  "require": {
    "slaxweb/ci-basecontroller": "~0.4"
  }
}

```

Then run **composer.phar install**. When finished, enable composer autoload in *application/config/config.php*.

Next create the directory in *application/config/* called *slaxweb*, and copy the configuration file found in *install/slaxweb/basecontroller.php* to the newly created directory. Or use the installation script found in *install* directory.

Congratulations, BaseController is installed.

View loading and data
=====================

[](#view-loading-and-data)

Example
-------

[](#example)

```
