Bug? suffix problem
- Single Page
Posted 10 February 2012 - 16:54 PM
i'm using this amazing libray to develop my backend but i have a big problem.
I'm using CodeIgniter for the frontend and i set a suffix (.html) for my pages and when i render the table with grocery CRUD the edit button doesn't work cause it doesn't recognize the .html suffix of the link.
How can i fix?
Posted 11 February 2012 - 00:29 AM
list($tmp, $first_segment) = explode("/",$_SERVER['PATH_INFO']);
$config['url_suffix'] = $first_segment == 'admin' ? '' : '.html';
The 'admin' is just the controller name you can change it for example 'backoffice' or whatever. Is it good also to not use in general suffix because in my personal experience I had lot of issues with this. Though if you like to use it is OK but try to avoid it at your backend controller with this simple hack.
Posted 11 February 2012 - 09:50 AM
By the way your code returned an error on te explode function
A PHP Error was encountered
Severity: Warning
Message: Wrong parameter count for explode()
Filename: config/config.php
Line Number: 60
Posted 11 February 2012 - 14:18 PM
list($tmp, $first_segment) = explode("/",$_SERVER['PATH_INFO']);
I just writed to the forums code not even in an editor!!! But you get the point anyway.
I edited the code so perhaps other users can use it.
Not using a suffix it was the best thing for you. I really had many problems with suffixes in past and I don't use them anymore unless it is really necessary.
Posted 11 February 2012 - 14:41 PM
Oups you are right. I didn't check it actually to tell you the truth. The right thing was:
list($tmp, $first_segment) = explode("/",$_SERVER['PATH_INFO']);
I just writed to the forums code not even in an editor!!! But you get the point anyway.
I edited the code so perhaps other users can use it.
Not using a suffix it was the best thing for you. I really had many problems with suffixes in past and I don't use them anymore unless it is really necessary.
[/quote]
no problem and thank you for the support!
I hope to find an answer to my other multiple insert question now xD
Posted 05 October 2012 - 16:14 PM
i know the last answer is a long time ago but the problem ist still there ... (http://www.grocerycrud.com/documentation/known-issues)
isn't it better to change it like this:
libraries/grocery_crud.php
search for "site_url()" and replace with base_url() ...
for me this works