Welcome Guest, Not a member yet? Register   Sign In
Modular Extensions - (HMVC) - Version 3.1.9
#81

[eluser]Avatar[/eluser]
This works:
Code:
function run($module, $data = '', $method ='index')
    {
        $class =& modules::load($module);
        return (method_exists($class,$method))? $class->$method($data) : $class->index($data);
    }
Thank you.
#82

[eluser]wiredesignz[/eluser]
Would you prefer there was a default error() method in the module class which you could override in your module if the called method was missing.

Version 4.0.3 will include changes to the modules::run() method
Code:
function run($module, $data = '', $method ='index')
{
    $class =& modules::load($module);
    return (method_exists($class, $method))? $class->$method($data) : $class->_error($method);
}
#83

[eluser]wiredesignz[/eluser]
Version 4.0.3 will include changes to the module class

Code:
class Module
{
    function Module()
    {
        $ci =& get_instance();
        
        $this->load =& new Loader($this);
        $this->load->_assign_libraries($this, $ci);
        $this->load->_ci_assign_to_models();
        
        log_message('debug', ucfirst(get_class($this))." module initialised");
    }
    
    function index()
    {
        log_message('debug', ucfirst(get_class($this))." module: No index method defined");
    }
    
    function _error($method) //called by modules::run() if method is missing
    {
        log_message('error', ucfirst(get_class($this))." module: No ".$method." method defined");
    }
}
#84

[eluser]Avatar[/eluser]
Yes, that is good. Is there a way that we can have a get method for the current working module and an array of the variables within? That would be nice Smile Kinda like a mild debug dump Wink Works great with smarty as well reference below:

http://ellislab.com/forums/viewthread/60050/
just kinda weird to juggle both unless theres more seperation between smarty and ci but you can combine both and it feeds the ci output to smarty. I like it. Thanks for your great work.
#85

[eluser]wiredesignz[/eluser]
Yes, the modules helper actually has two debug methods you might like to look at.

modules::debug($any_object); will display the $any_object and list its loaded libraries, using $this will display the current module.

modules::debug_in($any_object) or modules::debug_in($any_array) will do a full dump on the subject.

NOTE:
If you debug_in() the CodeIgniter Core ($CI) you will get a page full of recursive arrays, this is not an issue because most of the recursions are just references back into $CI core objects.


Could we please continue this discussion in the Version 4 thread, saves me having to work across both. TIA Wink
#86

[eluser]Le Bang[/eluser]
<?
for($i=1; $i<=100000000; $i++)
{
echo "Good. Thask wiredesignz";
}
?&gt;

I want load language from language directory in module

application/modules/my_mudule/language

how do??
#87

[eluser]wiredesignz[/eluser]
Language libraries facility will be next to do in the Version 4.0.9 see the Version 4 thread
#88

[eluser]Le Bang[/eluser]
Help me !!

application/modules/my_module_folder/module_1.php

or

application/modules/my_module_folder/controllers/module_1.php

==> $content = modules::run('my_module_folder/module_1');
good.

But

in module_1.php

$this->load->view('view_1');

if view_1.php file exisits in application/views/ ===> load this view file => do OK.
if view_1.php file does not exisits in application/views/ but it exisitting in application/modules/my_module_folder/views/ ==> do not.

please. Help me
--------------
#89

[eluser]Le Bang[/eluser]
my_module_folder store collection module file
#90

[eluser]Avatar[/eluser]
firstly your module.php can be inside app/modules/module/controller/ or app/modules/module just make sure that your module is name same as the directory it's in




Theme © iAndrew 2016 - Forum software by © MyBB