Why I hate Code Igniter (and why ZF FTW!)
Filed Under (General) by Wenbert on 01-02-2008
Tagged Under : Code Igniter, Zend Framework
Here is a snippet from my code…
-
-
public function transaction($company_var=”, $company_value=”, $parent_var = ”, $parent_value=”, $current_page=‘1′, $offset_value=”)
-
{
-
//GET VARIABLES PASSED THRU FUNCTION
-
//I hate code igniter for this.
-
//I found out that you can have query strings later on
-
//UPDATE:
-
//But then again, Code Igniter sux at handling queries in the URL
-
//I especially hate that you have to pass "variables" to the Method and not
-
//being to get the variables directly from the URL using $_GET
-
//WTF?!?! I have to enable query strings in the config file?
-
//Did they just DISABLE a feature in PHP?
-
//I AM NEVER GOING TO USE CODE IGNITER AGAIN. Zend Framework FTW!
-
//I nevarrr had this problem in ZF! Zend Framwork FTW (again)
-
$data[‘RTCO’] = $company_value?$company_value:$_GET[‘RTCO’]; //Code Igniter is bullshit! I had to add this due to CI unable to $_GET properly!
-
$data[‘RTPA8′] = $parent_value?$parent_value:$_GET[‘RTPA8′]; //Code Igniter is bullshit! I had to add this due to CI unable to $_GET properly!
While in my other method, i have this…
-
-
redirect(‘?c=customer&m=transaction&RTCO=’.$company_value.‘&RTPA8=’.$parent_value.‘&col_manager_selected=’.$data[‘page’][‘col_manager_selected’]);
-
I don’t share your point of view. It is said at the beginning that CI doesn’t has GET method by default. A lot of people are using it the wrong way. The GET method shouldn’t be used for destructive or changing state requests. The POST method should be used for that. Anyway I think you are prejudiced about CI.
Hi Todor, i apologize for my ramblings… really, these are just frustrations
im my sample code - i used it for SELECTS in the SQL queries only…
thanks for sharing your point of view Todor
Damn buddy. No one put a gun to ur head and told u to use CI. Relax man.
CI is dope. It saves me shitload of time b/c they take care of all that mindless stuff for you. The trade-off? You have to learn their stuff…
My 2 cents.
^_^

It’s cool. I’m relaxed.
I’m not regretting that I used Code Igniter though. It is always good to learn something new. Still for the next project, I have my eyes on the Zend Framework instead of CI
Hehe.. I’m learning CI now, after becoming a symfony refugee. Somehow this sounds ominous…
I think I can work with CI’s default segmented URI in lieu of query strings though. We’ll see.
Brian, maybe you’d like to check this out: http://kohanaphp.com/
Kohana is a fork of Code Igniter. Check out video tutorials. You’ll see that Kohana handles “views” better. They have:
$view->variable_a = “This is a variable”;
instead of CI’s
$data[’variable_a’] = “This is a variable”;
The thing with not having $_GET by default is that you’ll never know when you need another variable passed to the function.
hey wenbert thanks for the heads up. Some plugin developers are moving to Kohana pala so I’m sure it’s worth a look.
hehe! pinoy! no prob, i also want to test out Kohana but i’m going to concentrate with Zend Framework as of the moment. i am currently in-love with it and i want to marry ZF.
Arguing over this is dumb. Code igniter sucks, it’s not being maintained, if you like it, move to Kohana, it’s the best MVC framework and is php5 only using it’s magic functions such as __autoload, which benchmarks super fast against all rival class factories. If you like Zend cuz it has libs pre built cool. MVC is better for me, easier to maintain, but if you like a different way, sweet. Use it, nobody cares, and nobody is right. Just like arguing about chocolate vs vanilla, it doesn’t matter.
Hey Buddy,
CodeIgniter is indeed Cool. If you are worried about _GET issue, try this workaround.
http://codeigniter.com/forums/viewthread/56389/#277621
Is it just me or is there something wrong with the CodeIgniter forums? I can’t seem to post and properly search items :/
Rajeev, that is exactly what I do not like about Code Igniter. All the workarounds and stuff that I am not supposed to think about. I never had problems like these with Zend Framework. Also for a very important project, I would not want to use a “workaround”. Just my two cents.
Also for long term solutions, I doubt the future of Code Igniter. Already, it has a fork: http://kohanaphp.com/
problem with _GET in CI??
use $this->uri->segment(n) n your done.
Thanks JOKERz. But what I do not get is that it is easier and it makes sense to do a $_GET[’x'] than doing $this->uri->segment(n). And I do not have to manually count the ‘n’.
How about the uri_to_assoc function which makes an array out of all the tokens in the query string?
To me, it’s much simpler and much more elegant than using the GET array and dealing with “?” and “=” and “&” in the query string.
$data[’RTPA8′] = $this->input->get(’RTPA8′);
Documentation FTW!