(created: January 22, 2015; last update: January 23, 2015)
Now that we’ve learned the basics regarding CodeIgniter, it’s time to start a tutorial about making our first application, a CMS (Content Management System) or blog, in CodeIgniter.
Our CMS (blog) will be a multilanguage one.
Also, in order to work fast, we will use an established css framework for the admin area. I will use Bootstrap.
We will start by creating an admin area and then we will look into creating the front area.
First of all, make sure you download the latest version of CodeIgniter (version 3). Why do I say this? Because starting with the second half of January 2015 the new session library was introduced, thanks to the great work of CI community and herculean effort of Andrey Andreev.
After installing CodeIgniter, make sure you follow Learn CodeIgniter 3 in small steps from step 1 to step 6. Also, it will be a good idea to install Composer for our application. You can see a tutorial in step 7. Just don’t install any packages yet.
Create a configuration file specific to our CMS
We have a configuration file named config.php, but this is for the application… I mean, for the CMS. But what if we want to use the same CMS for another site? That means, another title for the CMS, another administrator, etc.
So why not create our own configuration file. Let’ create a file named “cms_settings.php” inside application/config/development directory and put in the file whatever comes to our minds:
$config['cms_title'] = 'CI App';
$config['cms_dev'] = 'email@example.com';
For now, we only set a title for our CMS, and an email address for the developer of the site.
Now we go in our “autoload.php” file and make sure we load the configuration we’ve just created:
$autoload['config'] = array('cms_settings');
Simple, isn’t it?
- Step 1 – Create an admin area in CodeIgniter 3
- Step 2 – Create a template for admin area
- Step 3 – Securing the admin area with Ion Auth library – first, the settings
- Step 3.1 – Creating the login and logout page with Ion Auth
- Step 3.2 – Administer groups with Ion Auth
- Step 3.3 – Administer users with Ion Auth
- Step 3.4 – Creating the profile page with Ion Auth
- Step 4 – Create a multilanguage site with CodeIgniter
- Step 4.1 – Create the admin area for a multilanguage site in CodeIgniter
- Step 4.2 – Set up the language for a multilanguage site in CodeIgniter
- Step 4.3 – Use “personalized” controllers and methods for a multilanguage site in CodeIgniter
- Step 4.4 – Returning to our MY_Controller. Doing everything that needs to be done for better working with languages
- Step 5 – Administer static pages for our multilanguage CMS – creating the pages
- Step 5.1 – Administer static pages for our multilanguage CMS – listing the created pages
- Step 5.2 – Administer static pages for our multilanguage CMS – editing the pages
- Step 5.3 – Administer static pages for our multilanguage CMS – deleting the pages
- Step 6 – Creating categories for a multilanguage site in CodeIgniter
- Step 7 – Using the language files for a multi-language site in CodeIgniter
- Step 8 – Putting it all together. How do visitors access our pages