I've spent quite sometimes looking for this information, after lots of trial and errors I've found the solution.
If you want to know what is the param to be inserted in
$paginator->prev("Previous", null);
The second parameter has to be like below:
array("url"=>array("limit:".$limit)), url is fixed. In the array "name_of_param":"value_of_param"
If you have dynamic limit in your page, and you want to maintain it when you click on Previous or Next. This is the solution you need.
By the way, if your CakePHP is not up to date (like mine), when you want to do a toggle sort for your TH, the default function might not work. Update your pagination.php to this version:
https://trac.cakephp.org/changeset/8125
Then you'll be able to toggle this sort('Name', 'name')?>
Good luck!
Monday, May 25, 2009
Sunday, May 3, 2009
CodeIgniter - Removing index.php by Changing .htaccess and httpd.conf
I've done this many, many times. But whenever I setup a new site on a new developer machine, I will have to do research over and over again. I decided to write down the details, actually only a few steps.
- Remove the index.php in the CI config file
$config['index_page'] = ""; - Add .htacess file in the root of your application
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] - Uncomment the mod_rewrite in httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so - Change None to All
</Directory>
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all - As well as the web root folder (this is needed)
<Directory "C:Apache/htdocs">Options Indexes FollowSymLinks </Directory>
AllowOverride All
Order allow,deny
Allow from all
Subscribe to:
Posts (Atom)