本文整理汇总了PHP中Get::rawTags方法的典型用法代码示例。如果您正苦于以下问题:PHP Get::rawTags方法的具体用法?PHP Get::rawTags怎么用?PHP Get::rawTags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Get
的用法示例。
在下文中一共展示了Get::rawTags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
/**
* Tag Manager
* -----------
*/
Route::accept($config->manager->slug . '/tag', function () use($config, $speak) {
$tags = Get::rawTags('ASC', 'id');
Config::set(array('page_title' => $speak->tags . $config->title_separator . $config->manager->title, 'files' => $tags, 'cargo' => DECK . DS . 'workers' . DS . 'cargo.tag.php'));
$G = array('data' => $tags);
if ($request = Request::post()) {
Guardian::checkToken($request['token']);
// Check for duplicate ID
foreach (array_count_values($request['id']) as $id => $count) {
if (trim($id) !== "" && $count > 1) {
Notify::error(Config::speak('notify_invalid_duplicate', $speak->id));
break;
}
}
// Check for duplicate slug
foreach (array_count_values($request['slug']) as $slug => $count) {
if (trim($slug) !== "" && $count > 1) {
Notify::error(Config::speak('notify_invalid_duplicate', strtolower($speak->slug)));
break;
}
}
if (!Notify::errors()) {
$data = array();
$keys = $request['id'];
for ($i = 0, $count = count($keys); $i < $count; ++$i) {
if (trim($request['name'][$i]) !== "" && trim($request['id'][$i]) !== "" && is_numeric($request['id'][$i])) {
示例2: array
<?php
$bucket = array();
$url_base = rtrim($config->url_current, '\\/-.0123456789');
$json_order = strtoupper(Request::get('order', 'DESC'));
$json_filter = Request::get('filter', "");
$json_limit = Request::get('limit', 25);
if ($pages = Mecha::eat(Get::articles($json_order, $json_filter))->chunk($config->offset, $json_limit)->vomit()) {
foreach ($pages as $path) {
$bucket[] = Get::articleHeader($path);
}
}
$json = array('meta' => array('generator' => 'Mecha CMS ' . MECHA_VERSION, 'title' => $config->title, 'url' => array('home' => $config->url, 'previous' => $config->offset > 1 ? $url_base . '/' . ($config->offset - 1) : null, 'next' => $config->offset < ceil($config->total_articles / $json_limit) ? $url_base . '/' . ($config->offset + 1) : null), 'description' => $config->description, 'update' => date('c'), 'author' => array('name' => $config->author, 'url' => array('profile' => $config->author_profile_url)), 'offset' => $config->offset, 'total' => $config->total_articles, 'tags' => Get::rawTags()), 'item' => null);
if (!empty($bucket)) {
$json['item'] = array();
foreach ($bucket as $i => $item) {
$json['item'][$i] = array('title' => $item->title, 'url' => $item->url, 'date' => $item->date->W3C, 'update' => Date::format($item->update, 'c'), 'id' => $item->id, 'description' => $item->description, 'kind' => Mecha::A($item->kind));
Weapon::fire('json_item', array(&$json['item'][$i], $item, $i));
}
}
Weapon::fire('json_meta', array(&$json['meta']));
echo (isset($_GET['callback']) ? $_GET['callback'] . '(' : "") . json_encode($json) . (isset($_GET['callback']) ? ');' : "");