本文整理匯總了PHP中ReflectionMethod::ispublic方法的典型用法代碼示例。如果您正苦於以下問題:PHP ReflectionMethod::ispublic方法的具體用法?PHP ReflectionMethod::ispublic怎麽用?PHP ReflectionMethod::ispublic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ReflectionMethod
的用法示例。
在下文中一共展示了ReflectionMethod::ispublic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct(Request &$request, $matchs)
{
$path = 'Controller' . DIRECTORY_SEPARATOR;
if (isset($matchs['directory'])) {
$path = $path . $matchs['directory'] . DIRECTORY_SEPARATOR;
}
$path = $path . $matchs['controller'];
$method = 'action_' . $matchs['action'];
$class = str_replace(DIRECTORY_SEPARATOR, '_', $path);
$refObject = new ReflectionClass($class);
if ($refObject->getParentClass()->getName() != 'Controller') {
throw new Ada_Exception("The requested URL " . self::$uri . " was not found on this server");
}
$refMethod = new ReflectionMethod($class, $method);
if ($refMethod->ispublic()) {
ob_start();
$refMethod->invokeArgs(new $class(), isset($matchs['params']) ? $matchs['params'] : array());
$request->response->body(ob_get_contents());
ob_end_clean();
} else {
throw new Ada_Exception("The requested URL " . self::$uri . " was not found on this server");
}
unset($refMethod, $path, $method, $class);
}