本文整理汇总了PHP中Utility::buildFullLink方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::buildFullLink方法的具体用法?PHP Utility::buildFullLink怎么用?PHP Utility::buildFullLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::buildFullLink方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: navArray
/**
* Generate Nav Array
*
* Creates an array of navigation items to be used with the mustache templates.
*
* @return array
*/
public function navArray($displayLogout = false)
{
$navItems = array('' => 'Home', 'session' => 'Start', 'about' => 'About', 'terms' => 'Terms', 'privacy' => 'Privacy');
if ($displayLogout === true) {
$navItems['session/end'] = 'Logout';
}
$navArray = array();
$navArray['nav'] = array();
foreach ($navItems as $k => $v) {
if ($k === $this->active) {
// Class for active nav items.
$active = 'active';
} else {
$active = null;
}
$navArray['nav'][] = array('title' => $v, 'active' => $active, 'url' => Utility::buildFullLink($this->config, true, $k));
}
return $navArray;
}
示例2: Config
<?php
/**
* File: index.php
* User: zacharydubois
* Date: 2016-01-04
* Time: 20:47
* Project: Digital-Footprint-Profile
*/
namespace dfp;
// Create objects.
$config = new Config();
$view = new View($config);
$nav = new Nav($config);
// Create nav (Index is empty).
$nav->setActive('');
// Tell view the nav array.
$view->navArray($nav->navArray());
// Tell view what template and content.
$view->tpl('index');
$view->content(array('title' => 'Welcome | Digital Footprint Profile', 'sessionLink' => Utility::buildFullLink($config, true, 'session')));
echo $view->render();
示例3: filter_input
<?php
/**
* File: twitter.php
* User: zacharydubois
* Date: 2016-01-04
* Time: 20:49
* Project: Digital-Footprint-Profile
*/
namespace dfp;
$denied = filter_input(INPUT_GET, 'denied');
$config = new Config();
$session = new Session($config);
if (!isset($denied) || array_key_exists('oauth_verifier', $_GET)) {
// Create twitter.
$twitter = new Twitter($config, $session);
$twitter->accessToken();
$twitter->getPosts();
$session->setTMP('allowNext', true);
}
header('Location: ' . Utility::buildFullLink($config, false, 'session'));
示例4: render
/**
* Render
*
* Renders and returns the rendered template.
*
* @return string
* @throws Exception
*/
public function render()
{
if ($this->tpl !== 'email' && isset($this->content) && isset($this->tpl) && isset($this->nav)) {
$base = array('home' => Utility::buildFullLink($this->config, true), 'version' => VERSION, 'copyright' => $this->config->get('custom', 'copyright'));
$content = array_merge($base, array_merge($this->nav, array_merge($this->assetsArray(), $this->content)));
} elseif ($this->tpl === 'email') {
$base = array('home' => Utility::buildFullLink($this->config), 'version' => VERSION, 'copyright' => $this->config->get('custom', 'copyright'));
$content = array_merge($base, $this->content);
} else {
throw new Exception("View cannot render as required content is not set.");
}
return $this->mustache->render($this->tpl, $content);
}
示例5: endSession
/**
* Ends and Clears Session
*
* Ends the PHP session, deletes the cookie, and updates the session file expire time.
*
* @return true
* @throws Exception
*/
public function endSession()
{
// Remove the cookie.
setcookie(DFP_SESSION_NAME, $this->sid, time() - 1, Utility::buildFullLink($this->config, true, 'session'), $this->config->get('server', 'domain'), Utility::httpsBool($this->config), true);
// Update file expire.
$this->fileSession['dfp']['expire'] = time();
// Clear TMP
$this->clearTMP();
if (!$this->DataStore->write($this->fileSession)) {
throw new Exception("Unable to update session expire time.");
}
return true;
}
示例6: Config
*/
namespace dfp;
// Create config
$config = new Config();
// Create session instance.
$session = new Session($config);
// Create Nav
$nav = new Nav($config);
$nav->setActive('session');
// Create view.
$view = new View($config);
$view->navArray($nav->navArray(true));
$view->tpl('session');
// Twitter
if ($session->getTMP('twitter_name') === false) {
$twitter = new Twitter($config, $session);
$twitterButton = array('url' => $twitter->authorizeURL(), 'text' => 'Login with Twitter', 'classes' => '');
} else {
$twitterButton = array('url' => '#', 'text' => 'Twitter: @' . $session->getTMP('twitter_name'), 'classes' => 'disabled');
}
// Facebook
if ($session->getTMP('facebook_name') === false) {
$facebook = new Facebook($config, $session);
$facebookButton = array('url' => $facebook->authorizeURL(), 'text' => 'Login with Facebook', 'classes' => '');
} else {
$facebookButton = array('url' => '#', 'text' => 'Facebook: ' . $session->getTMP('facebook_name'), 'classes' => 'disabled');
}
// Render and return
$view->content(array('title' => 'Start | Digital Footprint Profile', 'listURL' => Utility::buildFullLink($config, false, 'session/list'), 'loginButtons' => array($twitterButton, $facebookButton)));
echo $view->render();