It is possible to create new helper instead of extending them ?

#1
[eluser]Rushino[/eluser]
Hello,

It is possible to create new helper instead of extending them ?

Thanks.

#2
[eluser]davidbehler[/eluser]
Sure, just place a file with the name of your helper in /application/helpers and add it to the autoload config file/load it manually.

E.g. place a file called debug_helper.php in /application/helpers with this content:
Code:
<?php
  function pre($var)
  {
    echo '<pre>';
    if(is_array($var)) {
      print_r($var);
    } else {
      var_dump($var);
    }
    echo '</pre>';
  }
?&gt;
Now you can either load the helper via $this->load->helper('debug'); or add it to application/config/autoload.php config.

#3
[eluser]Rushino[/eluser]
Thanks dude work like a charm.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.