本文整理匯總了PHP中ViewManager::Render方法的典型用法代碼示例。如果您正苦於以下問題:PHP ViewManager::Render方法的具體用法?PHP ViewManager::Render怎麽用?PHP ViewManager::Render使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ViewManager
的用法示例。
在下文中一共展示了ViewManager::Render方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Init
/**
* Initialize Page Manager
*
* ## Overview
*
* @uses SatanBarbaraApp
* @uses SessionManager
* @uses ViewManager
* @uses DebugManager
* @uses RouteManager
* @uses PageView
*
* @see RouteManager
*
* @param array An array of creds for SendGrid API.
* @return true Always unless fatal error or exception is thrown.
*
* @version 2015-07-05.1
* @since 0.5.1b
* @author TronNet DevOps [Sean Murray] <smurray@tronnet.me>
*/
public static function Init($params)
{
DebugManager::Log("Initializing Page Manager", '@');
DebugManager::Log($params);
$appConfig = SatanBarbaraApp::GetConfig();
/**
* @todo have config in it's own 'config' position instead of array_merge
*/
$data = array('app' => array_merge($appConfig[SATANBARBARA_CURRENT_ENVIRONMENT], array()), 'page' => $params);
DebugManager::Log("checking if logged in...", null, 3);
if (SessionManager::IsLoggedIn()) {
$data['session'] = array('is_auth' => true, 'account' => SessionManager::GetAccount());
DebugManager::Log("Got an account, checking for a saved program...", null, 3);
}
$Page = ucfirst($params['page']) . 'View';
DebugManager::Log("Searching for view with class name: " . $Page);
if ($Page::HasAccess(SessionManager::GetAccessLevel())) {
$Page::Init($data);
ViewManager::Render($Page);
} else {
DebugManager::Log("looks like this page requires auth but user isn't authenticated!");
RouteManager::GoToPageURI('login');
}
return true;
}