(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:
1 2 |
$config['cms_title'] = 'CI App'; $config['cms_dev'] = 'youremail@yourdomain.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:
1 |
$autoload['config'] = array('cms_settings'); |
Simple, isn’t it?
Daniel says:
pleas can the downloadable file be made available?
avenirer says:
Hello, a downloadable application that started from these tutorials can be found here: https://github.com/avenirer/CodeIgniter-multilanguage-site (for multilanguage site), and one here: https://github.com/avenirer/CodeIgniter-single-language-site (for single language site)
bin says:
what’s password for admin ? i cant login that
avenirer says:
Hello. The password is… “password”. Just don’t tell it to everybody.
vin says:
I like your blog. thanks for the tutorial I learned a lot in codeigniter. You made my day more productive to my job.
孤单的小猴子 says:
Hi,
Now Im following and learning ur tutorials, thanks for the effort to do this 🙂
Rodrigo says:
just a comment for newbies in this, add
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
to custom config, at least I need or get a php error, and take care in qoutes in the title
config->item(‘cms_title’);?>
Great tutorial!! thanks!
supri says:
Hi guys.
i have downloaded the app. I created the database and import the tables. I dont know how to run the app.
localhost/CMS/admin still didnt work. how can i fix it?
avenirer says:
Hello… Don’t just download the app. Follow the tutorials. It’s an important part. 🙂
Jovin says:
Many thanks for the tutorial.
I’m downloading your multilanguage tutorial code now.
ian says:
maybe for a week i’ll be in your blog, to learning.. 🙂
i’m very love coding, i’m appreciate it of this all.. for other visitor, don’t try some shortcut with just download done project. Just read and follow step by step in article, if you done with small project than challenge’s yourself to make lite modification on coding (at mean adding your own plugin or Etc). That would be great from nothing to something.. 🙂
i’m newbie too.. 🙂
jimit says:
how setup programm
please tell me i am facing problem
avenirer says:
Hmm… Where should I start?
Giorgi says:
Thank for great tutorial 🙂
But I have one question… Are you going to add some chapters about front-end of the cms?
Sorry for my bad English 🙂
avenirer says:
Hello. I am glad you liked it, but no… As long as you have the MY_Controller I made and the Findcontent controller, all should go easy from there on….
HENG MENG HEANG says:
good goooood job, thanks thanks
avenirer says:
You’re welcome. The donation link is on the right sidebar 🙂
Orbisquare says:
Hi avenir,
I like your tutorial.
“Well… I’m out of ideas on what to write about. Do you have any ideas? Please, write me in any comment section you find, and I will do my best to tell you about that particular subject”
Would you in the future make tutorial about laravel framework with ajax?
That’d be great i guess.
But anyway this tutorial is awesome and you save a lot of time..
so thank you..
Ollie says:
Great tutorial. Will this work on the latest CI version?
I was keen to try your single language version.
Thx
avenirer says:
yes…