Problem installing HMVC |
[eluser]nyxynyx[/eluser]
I have a existing working installation of CI 2.02 that autoloads libraries and helpers. When I perform the HMVC installation by dropping the core and 3rd party files into their respective locations in the CI directory, I get the error Code: Fatal error: Cannot access empty property in C:\xampp\htdocs\APPNAME\application\third_party\MX\Loader.php on line 208 When I remove all helpers from application/config/autoload.php, i get Code: An Error Was Encountered When I use a clean CI installation with no libraries or helpers autoloading, it works fine. What should I do to get HMVC and autoloading to work?
[eluser]InsiteFX[/eluser]
This really depends on how you setup HMVC you would need to show your code on how you have HMVC setup. I use HMVC all the time and have no problems so I think you may have it setup wrong. InsiteFX
[eluser]nyxynyx[/eluser]
I installed HMVC by following the instructions on their website (https://bitbucket.org/wiredesignz/codeig.../wiki/Home). I only did Step 15 and doing Step 6 shows the error I mentioned earlier. I have a single controller file in /application/controllers, a single model file in /application/models and a single view file in /application/views which I move to /application/modules/site/controllers, /application/modules/site/models and /application/modules/site/views respectively. I left the config.php, autoload.php anad database.php as they are in the application folder. Before installing HMVC (performing Steps 1-6 from their website), I already have a existing CI project. I am autoloading some libraries and helpers (database, session, file, url, forms, text) using application/config/autoload.php. Is there any more info that I need to show to figure out where the problem lies in? This is my first CI project so its nothing fancy. Thanks!
[eluser]InsiteFX[/eluser]
Did you create your own MY_Controller and extend your Controllers from the MY_Controller? My HMVC setup is a little bit different then how he does it in the WIKI but if need be I can post the code here for you, the only think different is that I move the HMVC to application/libraries instead of third_party! InsiteFX
[eluser]nyxynyx[/eluser]
I extended CI_Controller and not MY_Controller. I referred to this tutorial and they did not extend MY_Controller (http://net.tutsplus.com/tutorials/php/hv...plication/). Following their tutorial did not get me the errors as I did when I used my own files. Please let me have a look at some of your code, thank you! ![]()
[eluser]InsiteFX[/eluser]
You need to extend it from MY_Controller, If you look in the application/core folder it should be there if you did the installation correct! If you open up MY_Controller you will see that it is extending the MX_Controller. Code: class MY_Controller extends MX_Controller { Now take and extend your application/modules/welcome/controllers/welcome.php from Public_Controller or Admin_Controller for like a backend dashboard. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |