HMVC: problem when controller extends from MX_Controller |
[eluser]Unknown[/eluser]
Hello, The problem is when my controller extends from 'MX_Controller', php thows an error message like ' Fatal error: Cannot redeclare class CI in application\third_party\MX\Base.php on line 83' My code is : Code: class Javascript extends MX_Controller { But, my code's working when the controller extends only from Controller. Why? Patrice
[eluser]bl00dshooter[/eluser]
http://philsturgeon.co.uk/index.php/news...ing-it-DRY
[eluser]Unknown[/eluser]
My problem concern Modular Extensions - HMVC. MX_Controller is an controller for Modular Extensions - HMVC, and when one of my controller extends from it, PHP throw the error : Fatal error: Cannot redeclare class CI in application\third_party\MX\Base.php on line 83 because in the 'third_party/MX/Base.php'. I have monitoring the tutorial page on HMVC at the url https://bitbucket.org/wiredesignz/codeig.../wiki/Home . Patrice
[eluser]Andrewgwood[/eluser]
Your controller should extend MY_Controller not MX by default. You need to either change the prefix in config/config.php from MY_ to MX_ or in libraries/my_controller.php add a definition for class MY_controller extends MX_Controller since the mx controller is loaded into that file Hope that helps
[eluser]Unknown[/eluser]
if you want admin_controller to extends MX_controller, you should have a Admin_controller class in library folder. <?php (defined('BASEPATH')) OR exit('No direct script access allowed'); class Admin_Controller extends MX_Controller { function __construct() { parent::__construct(); } } then any controller can extends Admin_Controller.
[eluser]InsiteFX[/eluser]
1) State what version of CodeIgniter you are using! CI 2.0 place in application/core - CI 1.7.x place in application/libraries Code: class MY_Controller extends MX_Controller { All other Controllers go into application/controllers. InsiteFX
[eluser]wiredesignz[/eluser]
@sportif, Read the Modular Extensions HMVC Bitbucket wiki regarding constructors. |
Welcome Guest, Not a member yet? Register Sign In |