modules::run in view problem |
[eluser]Webjema[/eluser]
Hello. About 2 hours looking for a solution, but without result (wiki and forum studied). So, I have module [app/modules/mainpage/controllers/mainpage.php] Code: class Mainpage extends MX_Controller { please note: class Mainpage extends MX_Controller The view [app/modules/mainpage/views/mainpage_page.php] Code: <!DOCTYPE html> And I have module [app/modules/welcome/controllers/welcome.php] with view [app/modules/welcome/views/welcome_page.php] But my page has only "<h1>Mainpage</h1>" output. No welcome view inside. No errors. What is wrong? I tried: Code: <?php echo modules::run('welcome/welcome'); ?> No results. In browser http://domain.com/welcome/welcome works fine. Please, help run it.
[eluser]osci[/eluser]
Code: modules::run('welcome');
[eluser]wiredesignz[/eluser]
The module controller must extend MX_Controller if you use HMVC features. Calls to run a controller which has the same name as it's module only requires the name once ie: modules::run('welcome').
[eluser]osci[/eluser]
[quote author="Webjema" date="1308366993"]Thank you! Code: modules::run('welcome'); wiredesignz explained why though. You should read his post carefully to understand and not just say works.
[eluser]Webjema[/eluser]
BUT I tried run another big module and no results. How I can debug this process (modules::run)? It is silent ![]()
[eluser]Webjema[/eluser]
[quote author="osci" date="1308367283"] wiredesignz explained why though. You should read his post carefully to understand and not just say works.[/quote] I've do =) My first post. I have made focus on "extends MX_Controller". And I've understand about the same name of controller and module. I've missed something?
[eluser]osci[/eluser]
for a start enable error reporting (enabled by default in reactor if development mode) go in config.php and set logtreshold='2' run your code check your application/log files for errors If you want more set a debugger like xdebug (google for how to) and watch. Edit: Quote:I’ve missed something?Maybe it has to do with my local time and me being tired. No offence.
[eluser]Webjema[/eluser]
[quote author="osci" date="1308367615"]for a start enable error reporting (enabled by default in reactor if development mode) go in config.php and set logtreshold='2' run your code check your application/log files for errors [/quote] Great! So logs: Code: DEBUG - 2011-06-18 01:30:03 --> File loaded: app_ci_folder/modules/welcome/views/welcome_message.php The problem: domain.com/account/sign_in - works. But calling Code: <?php echo modules::run('account/sign_in'); ?> Some restrictions for called modules? Why Module controller failed to run: account/sign_in ?
[eluser]osci[/eluser]
Is account extending MX? Is your loader correct? Do you have a custom MY_Loader? you can always use in your code Code: log_message('debug','Your message'); |
Welcome Guest, Not a member yet? Register Sign In |