Welcome Guest, Not a member yet? Register   Sign In
You must be joking
#1

[eluser]@li[/eluser]
So after about an year i decide to download codeigniter's framework and update my projects.

However after doing everything and clicking refresh, I see the error 'Undefined class 'Controller' and 'Undefined Class 'Model'.

You must be joking! These core classes have been renamed to CI_Model and CI_Controller?

First off, this is a dumb idea and makes coding harder, 'Controller' and 'Model' were a lot more intuitive names. Secondly, this breaks backward compatibility big time,are we now expected to go through all our files changing class names?

FFS! Please think before making changes like this in future.
#2

[eluser]InsiteFX[/eluser]
There is no more backwards compatibility CI 2.0.+ is PHP 5+ now

As far as Controller and Model they were renamed to be compatiable with the rest of the CI_ Classes.

InsiteFX
#3

[eluser]Eric Barnes[/eluser]
No joking it was changed in the v2.0.0 release -
Quote:Added CI_ Prefix to all core classes.
and listed in the upgrading steps -
http://ellislab.com/codeigniter/user-gui...e_200.html

This was done to standardize all core classes and actually make it more flexible.

Any time you upgrade an application you should always read the change log and the upgrade steps. There is never a guarantee things are not going to change. Especially going from a 1.x to 2.x.
#4

[eluser]@li[/eluser]
Things can change but before making a radical change like this you should consider all the apps that you'll be breaking! Besides 'Controller' and 'Model' are much more intuitive names than CI_Controller and CI_Model
#5

[eluser]@li[/eluser]
The apps that a person builds are not part of CodeIgniter, if I use CodeIgniter to make a shopping cart then my app is that shopping cart, its not CodeIgniter. Why should my shopping cart controllers have to extend from CI_Controller instead of the neutral Controller?
#6

[eluser]Developer13[/eluser]
Why on earth are you complaining about this? It's an easy fix. Quick search and replace of all "extends Controller" to "extends CI_Controller", etc. What's to complain about? Plus, as has already been pointed out, it was documented.

Why would you blindly upgrade your apps without reading the release notes and changes?
#7

[eluser]@li[/eluser]
1) Like I said Controller and Model are a lot more intuitive names, there was no reason to change such an old, established coding convention. For 4 years I've been coding with Controllers and Models and now I have to break my old habit and do CI_controller and CI_Model. Very annoying.

2) Is the word 'controller' and 'model' used only as the class names in your project? In mine the word 'Model' is used many times in many places, e.g $this->load->model(). And also, I have several types of Controllers, AdminController extends Controller, CrudController extends Controller, etc, there's no way for me to change this except manually.

I know nothing can be done about this now, but please THINK before breaking established conventions in the future.
#8

[eluser]danmontgomery[/eluser]
Seriously? You don't know how to do a search/replace for "extends Controller"/"extends CI_Controller"?

There has been discussion about changing Controller/Model to CI_Controller/CI_Model for probably at least a year at this point. Well before 2.0 was released. To claim that the change was made without any thought is silly, tbh.
#9

[eluser]@li[/eluser]
You realize that not everyone that uses CodeIgniter is on these forums...? This should've been on the homepage with a poll option, and no, doing a broad search/replace like that quite often brings about unexpected bugs which I'm unwilling to deal with.
#10

[eluser]JonoB[/eluser]
If you are unwilling to deal with this, then don't upgrade.




Theme © iAndrew 2016 - Forum software by © MyBB