本文整理汇总了PHP中F3::render方法的典型用法代码示例。如果您正苦于以下问题:PHP F3::render方法的具体用法?PHP F3::render怎么用?PHP F3::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F3
的用法示例。
在下文中一共展示了F3::render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: session_destroy
session_destroy();
F3::reroute('/');
}
F3::route('GET /', function () {
$facebook = F3::get('Facebook');
$uid = $facebook->getUser();
// Check if they are "logged in" by session, if they arent't,
// generate a Login URL and MAKE them sign in...
if (!$uid) {
$scope = array('offline_access', 'read_friendlists', 'email', 'user_relationships', 'user_relationship_details', 'friends_relationship_details', 'friends_relationships', 'manage_friendlists', 'read_stream', 'read_friendlists');
$login_url = $facebook->getLoginUrl(array('redirect_uri' => F3::get('FACEBOOK.redirect_uri'), 'scope' => implode(',', $scope)));
F3::set('login_url', $login_url);
// Load the header template
F3::set('extra_css', array('home.css'));
echo Template::serve('templates/header.html');
echo F3::render('templates/index.html');
// Load the footer template
F3::set('extra_js', array('bootstrap-collapse.js'));
echo Template::serve('templates/footer.html');
die;
}
//If they are logged, let's render the dashboard
// We need to store "user" for later use in the template
// http://fatfree.sourceforge.net/page/data-mappers/beyond-crud
$user = new Axon('user');
$user->load(array('fb_id=:fb_id', array(':fb_id' => $uid)));
// They shouldn't be able to access they dashboard if they're
// not in our database...
if ($user->dry()) {
_force_logout();
}