本文整理汇总了PHP中owa_coreAPI::displayImage方法的典型用法代码示例。如果您正苦于以下问题:PHP owa_coreAPI::displayImage方法的具体用法?PHP owa_coreAPI::displayImage怎么用?PHP owa_coreAPI::displayImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::displayImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: performAction
/**
* Invokes controller to perform controller
*
* @param $action string
*
*/
public static function performAction($action, $params = array())
{
// Load action from service map
$service = owa_coreAPI::serviceSingleton();
$action_map = $service->getMapValue('actions', $action);
// create the controller object
if ($action_map) {
$controller = owa_lib::simpleFactory($action_map['class_name'], $action_map['file'], $params);
} else {
// attempt to use old style convention
$controller = owa_coreAPI::moduleFactory($action, 'Controller', $params);
}
if (!$controller || !method_exists($controller, 'doAction')) {
owa_coreAPI::debug("No controller is associated with {$action}.");
return;
}
// call the doAction method which is part of the abstract controller class
// inherited by all other controller classes
$data = $controller->doAction();
// Display view if controller calls for one.
if (!empty($data['view']) || !empty($data['action'])) {
// Redirect to a view
if ($data['view_method'] == 'redirect') {
return owa_lib::redirectToView($data);
// return an image . Will output headers and binary data.
} elseif ($data['view_method'] == 'image') {
return owa_coreAPI::displayImage($data);
} else {
return owa_coreAPI::displayView($data);
}
} elseif (!empty($data['do'])) {
return owa_lib::redirectToView($data);
}
}
示例2: performAction
/**
* Invokes controller to perform controller
*
* @param $action string
*
*/
public static function performAction($action, $params = array())
{
// Load
$controller = owa_coreAPI::moduleFactory($action, 'Controller', $params);
if (!$controller || !method_exists($controller, 'doAction')) {
owa_coreAPI::debug("No controller is associated with {$action}.");
return;
}
$data = $controller->doAction();
// Display view if controller calls for one.
if (!empty($data['view']) || !empty($data['action'])) {
//
if ($data['view_method'] == 'delegate') {
return owa_coreAPI::displayView($data);
// Redirect to a view
} elseif ($data['view_method'] == 'redirect') {
owa_lib::redirectToView($data);
return;
// return an image . Will output headers and binary data.
} elseif ($data['view_method'] == 'image') {
return owa_coreAPI::displayImage($data);
} else {
return owa_coreAPI::displayView($data);
}
} elseif (!empty($data['do'])) {
//print_r($data);
owa_lib::redirectToView($data);
return;
}
}