PHP Requests Library within CodeIgniter

Simple way to use Requests for PHP with Codeigniter.

You may follow these few easy steps.

Step – 1

Unzip latest Requests for PHP zip and copy the contents of the library directory to {codeigniter_directory}/application/third_party/Request-{version} for example you have Requests for PHP 1.6.0 and your CI project is in /usr/sites/www/myproject then copy the files to /usr/sites/www/myproject/application/third_party/Requests-1.6.0.

Continue reading

Dynamically Add Javascript and CSS Files in CodeIgniter Header Page

Those who are developing web projects know that, header pages are always the constant file of their template folder. The classic way of using a header page in small projects are to fill it with constant JavaScript and CSS files along with html tags and use it in inside functions where you need. The problem arise when you start to develop a bigger project where you need to use different JavaScript and CSS files. The bad practice is to load all needed files in the header page, that will also start to appear and load in the pages and sections which we do not need them. This will make the page load slow and will cause conflicts and usage problems.

Continue reading