Blog

How to Use Code Hinting in PHPStorm for Codeigniter

PHPStorm doesn't show code hinting for Codeigniter classes by default. We can do it with a little efforts. Follow these simple steps to achieve it: Step1: Open a Codeigniter Project in PHPStorm and open a controller class in the editor. For example if we have a Controller class named Events open Events.php form controllers folder in editor (also we have a Model Class Events_Model from which we need to show code hinting inside controller class). Step 2: Put a class documentation comment at the top of the class declaration like this with @property : /** * Class Events * @property Events_Model $events_model */ Step 3. Now go to any method of the controller class and start typing Model's method calling in Codeigniter's way : $this->data['events']… read more >>

How to Remove index.php from Codeigniter urls

By default Codeigniter urls are generated with index.php in url like http://example.com/index.php/welcome/index read more >>

How to change the default no of records in DataTables

How to change the default no of records in DataTables

$('#example').dataTable( { "pageLength": 25 } );   read more >>

No Input File Specified Codeigniter Problem

If you are facing problem/error "no input file specified." in Codeigniter, here is a quick fix for that: Open .htaccess file in your favorite code editor and add ? (question Mark) after index.php in line which says: RewriteRule ^(.*)$ /index.php/$1 [L] your file should look like/similar as below after changes: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] It is a well known issue with some of web hosting servers for example Hostgator India and GoDaddy read more >>

Non Well Formed Numeric Value Encountered in PHP Date

If you get "non well formed numeric value encountered" error in PHP while using date() function to save into MYSQL database, use strtotime() function to correct this: $my_date = '20-12-2015'; echo date('Y-m-d', strtotime($my_date)); will output: 2015-12-20 which can be saved into MYSQL. read more >>

How to Get current page URL in WordPress

Put this code in your WordPress Theme's template file to get the url of current page. global $wp; $current_url = home_url(add_query_arg(array(),$wp->request)); read more >>