Tags

, ,

How to install Modular Extensions(HMVC) by WiredDesigns with Codeigniter 3.
Step 1:
Download the zip file at https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc
Extract the downloaded zip(e.g. wiredesignz-codeigniter-modular-extensions-hmvc-f77a3fc9a6fd.zip) into your local folder.
Step 2:
Next go to the extracted folder and copy the ff. files: MY_Loader.php, MY_Router.php and paste it inside your CI folder “application/core”
Step 3:
Next copy the MX folder and paste in “application/third_party” directory.
Step 4:
Change the permission of your MX folder.
$ chmod -R 755 MX
That’s it!

PROBLEM:
If you’ve encounter an error like this:

A PHP Error was encountered
Severity: Warning
Message: require(/var/www/_php/ci-blog/application/third_party/MX/Router.php): failed to open stream: Permission denied
Filename: core/MY_Router.php
Line Number: 4
Backtrace:
File: /var/www/_php/ci-blog/application/core/MY_Router.php
Line: 4
Function: _error_handler 

Fatal error: require(): Failed opening required '/var/www/_php/ci-blog/application/third_party/MX/Router.php' 
(include_path='.:/usr/share/php:/usr/share/pear') in /var/www/_php/ci-blog/application/core/MY_Router.php on line 4
...

SOLUTION:
We need to change the folder permission.
$ chmod -R 755 MX

PROBLEM:
If you’re using CI 3.1.3 and your HMVC is 5.5 then you may encounter an error like this:

Fatal error: Call to undefined method MY_Loader::_ci_object_to_array() 
in /var/www/_php/ci-blog/application/third_party/MX/Loader.php 
on line 300

SOLUTION:
Open the file /application/third_party/MX/Loader.php and modify it..
from

return $this->_ci_load(array('_ci_view' => $view, 
'_ci_vars' => $this->_ci_object_to_array($vars), 
'_ci_return' => $return));

into

return $this->_ci_load(array('_ci_view' => $view, 
'_ci_vars' => $this->_ci_prepare_view_vars($vars), 
'_ci_return' => $return));

Tadahh it works!!

Advertisements