Welcome Guest, Not a member yet? Register   Sign In
HMVC Issue
#1

[eluser]karlaykarlay[/eluser]
Hi All,

I have decided to use Modular extension in my CI project.
I have downloaded the ME libraries and stored them in ./system/application/libraries.
Now I have
- Controller.php
- Modules.php
- MY_Router.php
in application/libraries.

My Config file has....



Code:
/* Detect ssl connectivity */
if ( isset($_SERVER['HTTPS']) )
    $ssl = $_SERVER['HTTPS'];
elseif ( isset($_SERVER['HTTP_FRONT_END_HTTPS']) )
    $ssl = $_SERVER['HTTP_FRONT_END_HTTPS'];
else
    $ssl = "OFF";

$root = (stripos($ssl, "ON") !== FALSE) ? "https" : "http";

/* Many pages/apps served through the same domain */

if ( isset($_SERVER['HTTP_X_FORWARDED_HOST']) ) {
    list($host) = explode(',', str_replace(' ', '', $_SERVER['HTTP_X_FORWARDED_HOST']));
} else {
    $host = $_SERVER['HTTP_HOST'];
}

$root .= "://".$host;

if ( ! isset($_SERVER['ORIG_SCRIPT_NAME']) )
{
  $root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
}
else
{
  $root .= str_replace(basename($_SERVER['ORIG_SCRIPT_NAME']),"",$_SERVER['ORIG_SCRIPT_NAME']);
}

$config['base_url'] = "$root";

Then I created Sub Modules under Application. Now my directory looks like...

./system/application
/staffprofilemanagement
/admin
/controllers
/crEntityCntrlr.php
/views
/models
/libraries
/config

Then I try to access using the url....

http://localhost/staffprofilemanagement/...oadCollege

I'm getting the error 404 File not found.
Please anybody solve this issue.
#2

[eluser]überfuzz[/eluser]
Use the code-button right over the textarea to highlight your code. That makes it easier to follow.
Code:
/* Detect ssl connectivity */
if ( isset($_SERVER[‘HTTPS’]) )
  $ssl = $_SERVER[‘HTTPS’];
elseif ( isset($_SERVER[‘HTTP_FRONT_END_HTTPS’]) )
  $ssl = $_SERVER[‘HTTP_FRONT_END_HTTPS’];
else
  $ssl = “OFF”;

$root = (stripos($ssl, “ON”) !== FALSE) ? “https” : “http”;

/* Many pages/apps served through the same domain */

if ( isset($_SERVER[‘HTTP_X_FORWARDED_HOST’]) ) {
  list($host) = explode(’,’, str_replace(’ ‘, ‘’, $_SERVER[‘HTTP_X_FORWARDED_HOST’]));
} else {
  $host = $_SERVER[‘HTTP_HOST’];
}

$root .= “://”.$host;

if ( ! isset($_SERVER[‘ORIG_SCRIPT_NAME’]) )
{
  $root .= str_replace(basename($_SERVER[‘SCRIPT_NAME’]),”“,$_SERVER[‘SCRIPT_NAME’]);
}
else
{
  $root .= str_replace(basename($_SERVER[‘ORIG_SCRIPT_NAME’]),”“,$_SERVER[‘ORIG_SCRIPT_NAME’]);
}

$config[‘base_url’] = “$root”;
#3

[eluser]wiredesignz[/eluser]
try
Code:
./system/application
        /modules
                /staffprofilemanagement
                       /controllers
                                crEntityCntrlr.php
                       /views
                       /models
                       /libraries
                       /config

the URL is malformed also
Code:
/* http://localhost/staffprofilemanagement/admin/index.php/crEntityCntrlr/loadCollege */
http://localhost/index.php/staffprofilemanagement/crEntityCntrlr/loadCollege
#4

[eluser]karlaykarlay[/eluser]
Soory Not working with the URLs

http://localhost/staffprofilemanagement/...oadCollege
http://localhost/modules/staffprofileman...oadCollege

Any setup I should have??????????

I use PHP5.
#5

[eluser]wiredesignz[/eluser]
Yes you should have a working CodeIgniter setup.

Neither of those URLs would work with ordinary CI let alone with HMVC.

For you I recommend making your code function as a normal application before you move it into a module.

Once you have an understanding of CI application structure then you can use modules more easily.
#6

[eluser]karlaykarlay[/eluser]
Actually I had been running my code with CI without modularising.

The same controller (crEntityCntrlr.php) was working fine before.

But I wanted to have many modules work together. So putting files of all modules inside controller would make confusion. So I downloaded ME to libraries. I knew I miss some setup but couldn't figure out. If you could help me then it will be fine.
#7

[eluser]karlaykarlay[/eluser]
Can Anyone give me a clear idea about the Directory structure of CI being modularized, The setup and Calling info...........
#8

[eluser]karlaykarlay[/eluser]
Some how I tried to fix the problem and got struc with some other error.

"The configuration file config.php does not exist."

Please Help.........

Actually I changed the url to

http://localhost/index.php/staffprofilem...oadCollege

and got the above error.
#9

[eluser]wiredesignz[/eluser]
Modules directory structure image is attached.
#10

[eluser]karlaykarlay[/eluser]
As per above directory structure I Used...

system/
system/application/
system/application/modules/
system/application/modules/staffPMS/
system/application/modules/staffPMS/admin/
system/application/modules/staffPMS/admin/controllers/
system/application/modules/staffPMS/admin/controllers/crEntityCntrlr.php


But I'm getting the following error for URL


http://localhost/index.php/staffPMS/admi...oadCollege


An Error Was Encountered
Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.

Needed Help.........




Theme © iAndrew 2016 - Forum software by © MyBB