Welcome Guest, Not a member yet? Register   Sign In
Cannot redeclare class Model
#1

[eluser]timobg[/eluser]
Hello All,

I am a novice in CodeIgniter. I installed HMVC extension and the newest ActiveRecord library.
And I am trying to load a model, but is only says 'cannot redeclare class Model'.

I tried to extend the model directly to class Model (not ActiveRecord), but the same thing, so I assume it is not from the ActiveRecord.

Please, if anybody had had the same problem, share the solution or what it causes it.

Best regards!
#2

[eluser]timobg[/eluser]
I am sorry!

Actually the problem comes from the ActiveRecord Class, but still can't figure out where and what it is
#3

[eluser]WanWizard[/eluser]
What is "the newest ActiveRecord library"?

And what line of code triggers the "cannot redeclare class Model" error?
#4

[eluser]timobg[/eluser]
I downloaded the ActiveRecord Class version 0.3.2 and the error triggers in the Model Class file on the declaration line - 27

P.S. When I removed the class and loaded the 'model' extended to the Model class, it did not trigger any errors.
#5

[eluser]timobg[/eluser]
I think I found out where the error comes from.

In the Wiki implementation instructions is written to include the library in the autoload.php file, so I did it and here the error triggers.

Quote:Next, edit /application/config/autoload.php and make sure that both the ActiveRecord and database libraries are automatically loaded when CodeIgniter runs:

I removed it from the autoload and it works for now...

Thanks anyway!
#6

[eluser]WanWizard[/eluser]
Hmm... Not sure I would want to build an application using a library that hasn't been maintained since September 24th 2007, over three years ago...

You might want to have a look at Datamapper instead.
#7

[eluser]timobg[/eluser]
OK, thanks!




Theme © iAndrew 2016 - Forum software by © MyBB