All pastes #720707 Raw Edit

read from folder

public php v1 · immutable
#720707 ·published 2007-09-30 16:50 UTC
rendered paste body
<?phpdefine('CAKE_ROOT', "/events");uses('folder'); $controllers = new Folder(CONTROLLERS); $list = $controllers->ls();$controllerList = $list[1]; // The list of the files in the controller directory// replace the text in $controllerList that matches the keys in the following array with the key's value:$removeEntries = array("_controller.php" => "", "controller_template.php" => "", "registrations_controller~.php" => ""); foreach($removeEntries as $key=>$value){	$controllerList = str_replace($key, $value, $controllerList);}$html = "<ul>\n";foreach($controllerList as $val){	if(!empty($val))	{		$html .= "\t<li><a href=\"". CAKE_ROOT  ."/$val\">".str_replace("_", " ", $val)."</li>\n";	}}$html .= "</ul>\n";echo $html;?>