CodeIgniter Forums
Modular Extensions - HMVC version 5.4 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Modular Extensions - HMVC version 5.4 (/showthread.php?tid=38057)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]InsiteFX[/eluser]
lol


Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]wiredesignz[/eluser]
@InsiteFX, Calls directly to classes are not case sensitive because only one class by this name can ever be loaded.

Code:
<?php echo modules::run('mod_one'); ?>

This code is ok, you do not need to add controller/method when the controller and module have identical names. The method will default to index in this case.


Modular Extensions - HMVC version 5.4 - El Forum - 06-24-2011

[eluser]InsiteFX[/eluser]
ya, I was just showing him how you explain on the WIKI how to do module::run

Thank's for the update.

InsiteFX


Modular Extensions - HMVC version 5.4 - El Forum - 06-25-2011

[eluser]tcgonline01[/eluser]
Oh thanks every one!
i changed mod_one_view.php and mod_two_view.php to mod_one.php and mod_two.php, it's working.

But it's not worked when I use Codeigniter Template Class

mod_one.php
Code:
class Mod_one extends CI_Controller {
    
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
           //Write content from a View 'mod_one'to a region 'content'
           //function write_view($region, $view, $data = NULL, $overwrite = FALSE){}
          $this->template->write_view('content', 'mod_one', '', TRUE);
          $this->template->render(); //Render the master template
        }
}


mod_two.php
Code:
class Mod_two extends CI_Controller {
    
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
           //Write content from a View 'mod_two' to a region 'content'
           //function write_view($region, $view, $data = NULL, $overwrite = FALSE){}
          $this->template->write_view('content', 'mod_two', '', TRUE);
          $this->template->render(); //Render the master template
        }
}


The master template: Application/views/template_main.php
Code:
<html >
<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

</head>

<body>

<div>&lt;?php echo $content; ?&gt;</div>
<div>&lt;?php echo Modules::run('mod_one')?&gt;</div> //=> This is not worked
&lt;/body&gt;
&lt;/html&gt;

plz help me how to use template class and Modular Extensions - HMVC

you can download template here:
Code:
http://williamsconcepts.com/ci/codeigniter/libraries/template/



Modular Extensions - HMVC version 5.4 - El Forum - 06-25-2011

[eluser]InsiteFX[/eluser]
What do you have in content? If you r content is empty then it will not display anything!

InsiteFX


Modular Extensions - HMVC version 5.4 - El Forum - 01-19-2012

[eluser]psychoder[/eluser]
form validation callbacks are not triggered...
can someone help me to point out the changes needed to fix it??
please?


Modular Extensions - HMVC version 5.4 - El Forum - 01-19-2012

[eluser]wiredesignz[/eluser]
@psychoder, http://ellislab.com/forums/viewreply/969568/


Modular Extensions - HMVC version 5.4 - El Forum - 01-19-2012

[eluser]psychoder[/eluser]
@wiredesignz, thanks a lot... Smile


Modular Extensions - HMVC version 5.4 - El Forum - 01-25-2012

[eluser]ericrjones1[/eluser]
[quote author="wiredesignz" date="1326965330"]@psychoder, http://ellislab.com/forums/viewreply/969568/[/quote]

@wiredesignz With the new version of the framework 2.1.0, the quoted solution does not work any more since access to
Code:
$this->form_validation->CI
has been set to protected.

To have callback working again, you will need to extend CI_Form_validation and do something like the following:

Code:
class MY_Form_validation extends CI_Form_validation {
    
    public function set_ci_reference(MX_Controller $ci)
    {
        $this->CI = $ci;
    }
}

Then within your MY_Controller

Code:
class MY_Controller extends MX_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->library('form_validation');
        $this->form_validation->set_ci_reference($this);
    }
}

Thanks for all the hard work.



Modular Extensions - HMVC version 5.4 - El Forum - 01-25-2012

[eluser]wiredesignz[/eluser]
@ericrjones1, I suggest you look at the linked solution more carefully. There is a MY_Form_validation extension shown with a public $CI class variable.