本文整理汇总了PHP中Pages::instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Pages::instance方法的具体用法?PHP Pages::instance怎么用?PHP Pages::instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pages
的用法示例。
在下文中一共展示了Pages::instance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Request $request)
{
$this->request = $request;
parent::__construct($request);
// Load the page class
$this->page = Pages::instance();
}
示例2: view
/**
* Returns the value of a view ane merges the config with any data passed to it
*
* @param string name of view
* @param boolean|array optional array of data to pass to the view
* @param string file extension
* @param boolean|int lifetime of cache. if set to true it will use the default
* cache from the pages config or use an int if it is passed one
* @return string contents of view or cache file
*/
public static function view($view, $config = FALSE, $type = FALSE, $lifetime = FALSE)
{
$page = Pages::instance();
// Setup caching and return the cache file it it works
if ($lifetime) {
$cache = new Cache();
$cache_name = $page->getCacheIdForView($view . $type . serialize($data));
if ($output = $cache->get($cache_name)) {
return $output;
}
}
// Load the view
$view = new View($view, $config, $type);
$output = $view->render();
// Convert to markdown automatically
if ($type == 'markdown' || $type == 'mdown' || $type == 'md') {
$output = markdown::to_html($output);
}
// Store into cache
if ($lifetime) {
// Setup lifetime
if ($lifetime === TRUE) {
$lifetime = $page->cache_lifetime;
} else {
$lifetime = (int) $lifetime;
}
// Store the cache
$cache->set($cache_name, $output, NULL, $lifetime);
}
return $output;
}
示例3: init
/**
* Initialize Fansoro Pages
*
* <code>
* Pages::init();
* </code>
*
* @access public
*/
public static function init()
{
return !isset(self::$instance) and self::$instance = new Pages();
}
示例4: __construct
public function __construct()
{
parent::__construct();
// Load the page class
$this->page = Pages::instance();
}
示例5: function
active: false,
collapsible: true,
heightStyle: "content"
});
// Hover states on the static widgets
$("#dialog-link, #icons li").hover(
function () {
$(this).addClass("ui-state-hover");
},
function () {
$(this).removeClass("ui-state-hover");
}
);
});
</script>
</head>
<body>
<header class="grid_12 alpha">
<nav class="grid_12 alpha">
<?php
echo Pages::instance()->BuildMenu($user);
?>
</nav>
</header>
<div class="container">
<div class="grid_<?php
echo $user->isLoggedIn() ? 12 : 8;
?>
alpha">