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

[eluser]xwero[/eluser]
nice find Bramme! The only problem is that it returns the full filepath where the autoloader only requires the filename part before the _helper part. So you have to process the array values before you can use it as the helper autoload array.

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

$autoload['helper'] = $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