Welcome Guest, Not a member yet? Register   Sign In
Read/Load all php files with a certain ending?
#18

[eluser]xwero[/eluser]
if you only need them in one class you can change the _autoload part with the classnames so you know you only use them there and then you use the same code, except the $autoload['helper'] line in the contructor.

Code:
class Me extends Controller
{

   function Me()
   {
      parent::Controller();

      $files = glob(APPPATH.'helpers/*_me_helper.php');
      foreach($files as $key=>$file)
      {
           $files[$key] = str_replace('_helper.php','',substr(strrchr($file,'/'),1));
      }

      $this->load->helpers($files);
   }

   // ...
}


Messages In This Thread
Read/Load all php files with a certain ending? - by El Forum - 08-07-2008, 07:32 AM
Read/Load all php files with a certain ending? - by El Forum - 08-07-2008, 10:41 AM
Read/Load all php files with a certain ending? - by El Forum - 08-07-2008, 03:04 PM
Read/Load all php files with a certain ending? - by El Forum - 08-07-2008, 03:31 PM
Read/Load all php files with a certain ending? - by El Forum - 08-07-2008, 11:54 PM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 12:33 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 12:51 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 01:22 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 01:25 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 01:53 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 02:09 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 02:56 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 04:05 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 04:20 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 04:34 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 04:44 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 06:29 AM
Read/Load all php files with a certain ending? - by El Forum - 08-08-2008, 06:41 AM
Read/Load all php files with a certain ending? - by El Forum - 08-10-2008, 10:06 AM
Read/Load all php files with a certain ending? - by El Forum - 08-10-2008, 11:02 AM
Read/Load all php files with a certain ending? - by El Forum - 08-10-2008, 01:27 PM
Read/Load all php files with a certain ending? - by El Forum - 08-10-2008, 02:15 PM



Theme © iAndrew 2016 - Forum software by © MyBB