mamp - How to use HMVC for Codeigniter 2.1.* when index.php is moved? -
i trying build codeigniter application index.php inside "public" folder /applications/mamp/htdocs/public/
in website root. have setup vhosts etc point index.php file. wanted go module based approach , ended using modular extensions - hmvc . placed core files , third party files in corresponding folders, , created modules folder in application folder. proceeded create "login" module inside modules folder alongwith required "controllers/login.php" , "models" , "views"
class login extends mx_controller{ public function index() { log_message('error','reached module'); } }
now when try load http://localhost/login
, error log in apache_error.log saying
file not exist: /applications/mamp/htdocs/public/login
http://localhost
works fine displaying welcome screen of codeigniter gniter
this path structure :
application/modules └── login ├── config │ └── routes.php ├── controllers │ └── login.php └── views └── login.view.php
content of modules/login/config/routes.php
<?php $route['login'] = 'login';
httpd-vhosts config :
<virtualhost *:80> documentroot "/applications/mamp/htdocs/public" setenv app_env development <directory "/applications/mamp/htdocs/public"> options indexes followsymlinks includes execcgi allowoverride order allow,deny allow </directory> </virtualhost>
i managed code working. wrote small tutorial around on setting up. can refer here
Comments
Post a Comment