Page 1 of 1

trouble with phrame

Posted: Fri Jul 09, 2004 11:56 am
by mucahitkurt
i dont understand what is wrong with below code, it is from the phrame actionController class.

Code: Select all

$type = $actionMapping->getType(); 
$name = $type; 
if ($pos = strrpos($type,"/")) // strip directory from $type here. 
$name = substr($type,++$pos,strlen($type)-$pos); 
// process search-path 
if (!isset($this->_options[_ACTIONS_DIR])) $this->_options[_ACTIONS_DIR] = "actions/"; 
$separator = ":"; 
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $separator = ";"; 
$actionConfigDirs = explode($separator, $this->_options[_ACTIONS_DIR]); 
foreach ($actionConfigDirs as $actionPath) { 
if (!class_exists($type)) { 
if (file_exists ( $actionPath."/$type.php" )) 
require_once $actionPath."/$type.php"; 
} else break; 
} 
if (!class_exists($type)) { 
trigger_error("Invalid Action '$name' type '$type'"); 
return; 
} 

echo "flag_1 br>"; 

$action = new $type(); 

echo "flag_2!<br>"; 

set_error_handler($this->_options[_ERROR_HANDLER]); 
$actionForward = $action->perform($actionMapping, $actionForm); 
restore_error_handler(); 
return $actionForward;

it is echo flag_1 but not flag 2 and class exists, what is wrong?



feyd | Please use

Code: Select all

tags when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Jul 10, 2004 2:43 am
by kettle_drum
What is wrong with it? what errors do you get? What does it print?