I downloaded HMVC files from here and set up my CI 3 installation using these file
Place the MX folder in application/third_party folder
Place the files in application/core MY_Loader & MY_Router
$config['modules_locations'] = array(APPPATH.'modules/' => '../modules/',);
Created a folder module in application. Inside module created welcome/controller and welcome/view
In welcome/controller I copied the default welcome controller and in welcome/view welcome_message.
I deleted both files from application/controller and application/view.
Now I am getting 404 error.
You change name of folder "module" to "modules".
And in modules folder:
You must rename controller and view folder to controllers and views.
Hope this help :)
Related
Folder which is said to be where all the page templates located at could not be found with the following error: cd: templates: No such file or directory.
Will it be okay to re create the folder or is there something missing and need to be restored ?
Yes you have to create your folder app/Views/templates/ and add your templates inside.
CodeIgniter does not create the folder automatically.
I have created a codeigniter project (XYZ) in hmvc. Inside a project(ABC), i created app folder and uploaded XYZ project. So ABC.com works but ABC/app does not work. It says:
If you are using .htaccess then you have to allow XYZ folder name (app in your case) in ABC project .htaccess file.
Or Sometimes CodeIgniter won't find the controller.
Go to config > routers.php
and see the value of default_controller, update this as per your default controller.
I have implemented HMVC for creating modules in codeigniter . Now I want to create modules inside module but unfortunately I am getting 404 page.
My current directory structure
modules/api/v1
when I am putting controller inside api/controller folder then it's working fine but when I put a controller file under api/v1/controller folder then it showing me 404 error. I want this because after implementing this all the version of my api will be inside a single folder
Please give me your suggestion how can I do This
I have changed the name of codeigniter and placed htdocs then in application folder I have created a new folder in that new folder again I created some folders for different web pages in each and every folder I added controllers,models,view files. Now I want to access a controller file which is in the new folder.
I tried with default route but not working..Can anyone suggest
Create as many folders as you want inside the controller model and view folders in CodeIgniter and not outside them if you really want to organise them.
Remember to set base URL in application/config/config.php file and default router inside the application/config/routes.php file.
If you have problems please comment below describing errors.
I am creating a module called "Web" in magento 1.7.2. Folder structure is like app/code/local/Company/Web/ then Block, controllers, Model, etc, Helper. Again under controllers creating Adminhtml folder and IndexController.php file. Under Adminhtml folder ProductController.php file is there. I have another one file which is in my root folder called reader.php file. I want to include that file in my ProductController.php file. But unable to do so. I have tried by the following code:
$basePath = Mage::getRoot();
include($basePath.'/reader.php');
Please help me how to include the file.
Thanks in advance.
Mage::getRoot() gives you the app folder. You should use Mage::getBaseDir() instead. That will give you your absolute base dir.