How to make custom helper work. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to make custom helper work. (/showthread.php?tid=60118) Pages:
1
2
|
How to make custom helper work. - El Forum - 01-20-2014 [eluser]razerone[/eluser] [quote author="noideawhattotypehere" date="1390215322"]application/core/MY_Loader.php Code: class MY_Loader extends CI_Loader { usage Code: $views = array('header', 'column_left', 'footer'); I have all ready one that just doesn't let me echo <?php echo $header in view;?> I am looking in to some link like this now $data['header'] = $this->load->controller('common/header'); for controller How to make custom helper work. - El Forum - 01-20-2014 [eluser]InsiteFX[/eluser] View: Code: $this->load->view('header'); Controller: Code: // Setup $data array How to make custom helper work. - El Forum - 01-20-2014 [eluser]razerone[/eluser] [quote author="InsiteFX" date="1390221886"]View: Code: $this->load->view('header'); Controller: Code: // Setup $data array Here is way I am working on my controller home. Just need a function in a library or my_controller to make this work Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); home.tpl <-- Need to be able to echo like below in my home view Code: <?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?> How to make custom helper work. - El Forum - 01-20-2014 [eluser]razerone[/eluser] Thank for all your help to be able to load controller with in controller I had to do a couple of thing with all the information I have revived I worked it out working will be posting download version on github https://github.com/Carrara-Website-Solutions First Create I Application Path Core/ MY Loader File Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Controller Test1 Sample Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Controller Test2 Sample Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Now from Test1 you can echo out the controller in the view View file <?php echo $header; ?> |