Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - Version 4.3

[eluser]Maxximus[/eluser]
Hi, trying to port things to 4.1 (07). I have the following issues, and I can't figure out how to handle this...

Code:
in modules/someclass/controllers/someclass.php:
Class Someclass extends Controller {
...
function showForm() {
    $view = modules::run('vote/vote', $this->uri->rsegment(4), 'voteForm');
    $this->render($view);
}

function render($data, $cache = FALSE) {
    if ($cache) $this->output->cache($cache);
    echo $data;
}
...
}

in modules/vote/controllers/vote.php
Class Vote extends Controller {
...
function voteForm($data) {
    $view = $this->load->view('p_vote', $data, TRUE);
    $this->render($view);
}

function render($data, $cache = FALSE) {
    if ($cache) $this->output->cache($cache);
    echo $data;
}

...
}
Will not return anything. Tried several things, like returning the data, direct echo etc.

If I use a modules::run() in a view, the whole view stops (without error msg):
Code:
<? echo modules::run('vote/vote', $rec['id'], 'overallResults'); ?>

So basically: calling another module/controller/method is not giving output, and used in a view will stop the view completely. Any idea?

[eluser]Maxximus[/eluser]
Using 08 makes no difference, but now it seems that autoloaded classes are not available (it errors on $this->session->userdata(), but not with 07)

[eluser]wiredesignz[/eluser]
Hi Maxx, is the Session library autoloaded in application/config/autoload.php or the module/config/autoload.php?

I will restore the version 07 code to assign_libraries to the controller. Thanks Wink

[eluser]wiredesignz[/eluser]
Version 4.1.09 is available on the wiki.

Fixed language loader problem.
Restored assign_libraries functionality.

Thanks Maxx & dmitry. Your testing is really helpful Wink

[eluser]Maxximus[/eluser]
application/config/autoload.php. 09 restores it to the previous functionality.

Unfortunately still not possible to get modules::run() output.

[eluser]wiredesignz[/eluser]
Make sure you use TRUE to return a view from one module to another as per CI documentation.

Code:
return $this->load->view('view', $data, TRUE)

Otherwise please post your code so I can help.

[eluser]Maxximus[/eluser]
Ah found something: It's dying silently in the model after the first $query = $this->db->query($sql, $binds);, so probably the DB information is not available for the called module?

[eluser]wiredesignz[/eluser]
Well that might be it too. :lol:

[eluser]wiredesignz[/eluser]
Version 4.1.10 of Modular Extensions is available on the wiki.

Fixed database loading bug.
Fixed bug which prevented database from being available to module models. Thanks Maxximus. Wink

[eluser]Maxximus[/eluser]
Yess!! Now works perfect!

In order to get Sessions (DB) running, had to remove: $this->CI->load->database(); in sess_run() function.

Thanks mate!




Theme © iAndrew 2016 - Forum software by © MyBB