本文整理匯總了PHP中Uri::has方法的典型用法代碼示例。如果您正苦於以下問題:PHP Uri::has方法的具體用法?PHP Uri::has怎麽用?PHP Uri::has使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Uri
的用法示例。
在下文中一共展示了Uri::has方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
$post = array('alert' => '');
Model::load('admincp/comments');
if ($match = Uri::match('\\/comments\\/(\\w+)')) {
if (method_exists("controlComments", $match[1])) {
$method = $match[1];
$this->{$method}();
die;
}
}
$curPage = 0;
if ($match = Uri::match('\\/page\\/(\\d+)')) {
$curPage = $match[1];
}
if (Request::has('btnAction')) {
actionProcess();
}
if (Request::has('btnSearch')) {
filterProcess();
} else {
$post['pages'] = Misc::genSmallPage('admincp/comments', $curPage);
$filterPending = '';
if (Uri::has('\\/status\\/pending')) {
$filterPending = " AND c.status='0' ";
}
$post['theList'] = Comments::get(array('limitShow' => 20, 'limitPage' => $curPage, 'query' => "select c.*,p.title from " . Database::getPrefix() . "post p," . Database::getPrefix() . "comments c where c.postid=p.postid order by c.commentid desc", 'cacheTime' => 1));
}
System::setTitle('Comments list - ' . ADMINCP_TITLE);
View::make('admincp/head');
self::makeContents('commentsList', $post);
View::make('admincp/footer');
}
示例2: index
public function index()
{
if ($match = Uri::match('\\/jsonCategory')) {
$keyword = String::encode(Request::get('keyword', ''));
$loadData = Categories::get(array('where' => "where title LIKE '%{$keyword}%'", 'orderby' => 'order by title asc'));
$total = count($loadData);
$li = '';
for ($i = 0; $i < $total; $i++) {
$li .= '<li><span data-method="category" data-id="' . $loadData[$i]['catid'] . '" >' . $loadData[$i]['title'] . '</span></li>';
}
echo $li;
die;
}
$post = array('alert' => '');
Model::load('admincp/post');
if ($match = Uri::match('\\/post\\/(\\w+)')) {
if (method_exists("controlPost", $match[1])) {
$method = $match[1];
$this->{$method}();
die;
}
}
$curPage = 0;
if ($match = Uri::match('\\/page\\/(\\d+)')) {
$curPage = $match[1];
}
if (Request::has('btnAction')) {
actionProcess();
}
if (Request::has('btnSearch')) {
filterProcess();
} else {
$post['pages'] = Misc::genSmallPage('admincp/post', $curPage);
$filterPending = '';
if (Uri::has('\\/status\\/pending')) {
$filterPending = " WHERE p.status='0' ";
}
$post['theList'] = Post::get(array('limitShow' => 20, 'limitPage' => $curPage, 'query' => "select p.*,u.username,c.title as cattitle from " . Database::getPrefix() . "post p left join users u on p.userid=u.userid join " . Database::getPrefix() . "categories c on p.catid=c.catid {$filterPending} order by p.postid desc", 'cache' => 'no'));
}
System::setTitle('Post list - ' . ADMINCP_TITLE);
View::make('admincp/head');
self::makeContents('postList', $post);
View::make('admincp/footer');
}
示例3:
</div>
<div class="col-lg-12 text-right">
<?php
echo $pages;
?>
</div>
</div>
<!-- row -->
</form>
</div>
<div class="col-lg-4">
<?php
if (!Uri::has('\\/edit\\/\\d+')) {
?>
<div class="divAddnew">
<form action="" method="post" enctype="multipart/form-data">
<?php
echo $alert;
?>
<h4>Add new</h4>
<p>
<label><strong>Title</strong></label>
<input type="text" class="form-control" name="send[title]" placeholder="Title" id="txtTitle" />
</p>
<p>
<label><strong>Thumbnail</strong></label>
<input type="file" class="form-control" name="image" />
</p>
示例4: array
<?php
if (!Uri::has('^page\\-\\d+\\-.*?\\.html')) {
Redirect::to('404page');
}
$pageName = 'page';
$pageData = array();
$pageData['content_top'] = Render::content_top($pageName);
$pageData['content_left'] = Render::content_left($pageName);
$pageData['content_right'] = Render::content_right($pageName);
$pageData['content_bottom'] = Render::content_bottom($pageName);
$headData = GlobalCMS::$setting;
Theme::model('page');
$pageData['alert'] = '';
$pageData = pageProcess($pageData);
if (isset($pageData['keywords'])) {
$headData['keywords'] = $pageData['keywords'];
}
$headData['title'] = $pageData['title'];
if ($pageData['page_type'] == 'fullwidth') {
$pageName = 'pageFullWidth';
}
Theme::view('head', $headData);
Theme::view($pageName, $pageData);
Theme::view('footer');