Skip to main content

Introduction to CodeIgniter

Introduction

I've been playing around with CodeIgniter as my PHP web framework for a while now and I would like to share my simple steps in getting started with the tool. I think it's maybe too late to post this one up on the internet as there are lots of articles describing the said tool. But anyway, I'll just post this one so that I have some reference in the future how I did things to work with CodeIgniter.

CodeIgniter is a simple, light and fast web framework.

And web frameworks are encapsulation of the repetitive tasks we do when developing a website. One of the many important issue solved by this framework is maintenance. We get to have our code separated so that we have proper maintenance of our site. When I say separation of code, it's a conceptual thing. Web framework, most if not all, are implementation of the MVC pattern where we separate logic from presentation. It's model and view respectively. And CodeIgniter does that with ease.

Let me demonstrate. Mostly we do have actions as our PHP scripts, i.e. listcustomers.php to list all our customers. And we have code inside like so:

For some simple sites this works but imagine we'll have other scripts that does similar to this like listvendors.php, listitems.php. I'd imagine we'll separate the part where the connection is and include it in all of these scripts. Yes it solves the problem.

Download and Install

You need to have a web server and a PHP interpreter to run PHP and optionally we can install MySQL. I know these are lots but need not to worry. There's XAMPP to help us. Download and install XAMP and we've got all three working and ready to use.

Visit CodeIgniter website to download the said package. Assuming we put XAMPP to C:\xampp, we can unzip the package to C:\xampp\htdocs\codeigniter and that's it. We can now access the page through our browser. Open up your browser of choice and go to http://localhost/codeigniter/. Voila! We have a codeigniter website up and running.

Comments

Popular posts from this blog

Add Brave Browser to Netbeans

We'll I'm liking Brave now, great isn't it. With the token and all and privacy and stuff. And all the good stuff, right? So what other good thing we can do about it other than adding it to our favorite editor. So here it is, adding it is through Tools->Options->General Edit Web Browser Manager and add this setting below. Find the brave.exe usually it can be found in C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe and voila we're good. See you next posts everyone!

Monero is your friendly neighbor - no not really, I mean friendly CPU miner

Monero is another one of those crypto currency that was really big news in 2017. Now the year ends and hoping for a fresh start in 2018. Just got my masternode up and so far so good. X11 is the algo chosen by Sucre so it's not really friendly to CPU. Now, back to Monero. Its algorithm is Cryptonite and it's friendly to miners that only has CPU. First off, get your monero wallet here . As for me, I do use FreeWallet so I don't worry other app/web for every wallet that I have. Anyway, if you get your monero wallet address, that's OK. All we have to do is to find pool to mine. I use MineXMR as it's simpler. You can choose whatever you like, just search for "monero mining pools" and you get bunch to choose from. Get the miner here, extract it to your location of choice and edit the config.json file. {     "algo": "cryptonight",  // cryptonight (default) or cryptonight-lite     "av": 0,                // algorithm var...

Windows 10 HP Netbook Sucks, Lubuntufies it, Great!

I purchased a small netbook from HP few years back and it was installed with Windows 10 Home Edition. I tried it at the shop and works fine until I arrived at home and installed office suites, and some basic programming  tools like Chrome, Python, Visual Studio Code that it became useless. Now it lags and my daughter can't even work with office suites. It was for her, it was a gift, it's suppose to work and not bother her. And now it becomes a pain for her doing research and Google Chrome always says "Not Responding". I just remembered it was 2 years ago. The netbook was just kept at the closet, intended never to see the light again. I was cleaning my small office at home and I found it, I remembered the pain. I remembered it all like yesterday. It was horrible, I cried and asked God, why did I remember all those miseries. Seriously, I just found it, that's it, and just thought, well I think I can have a use for it for a small server at home. Then it hits me, it...