本文整理汇总了PHP中Uri::to方法的典型用法代码示例。如果您正苦于以下问题:PHP Uri::to方法的具体用法?PHP Uri::to怎么用?PHP Uri::to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Uri
的用法示例。
在下文中一共展示了Uri::to方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paginate
public static function paginate($page = 1, $perpage = 10)
{
$query = Query::table(static::table());
$count = $query->count();
$results = $query->take($perpage)->skip(($page - 1) * $perpage)->sort('title')->get();
return new Paginator($results, $count, $page, $perpage, Uri::to('admin/companies'));
}
示例2: paginate
public static function paginate($page = 1, $perpage = 10)
{
$query = Query::table(static::table());
$count = $query->count();
$results = $query->take($perpage)->skip(($page - 1) * $perpage)->sort('real_name', 'desc')->get();
return new Paginator($results, $count, $page, $perpage, Uri::to('users'));
}
示例3: link
public static function link($uri, $title = '', $attributes = array())
{
if (strpos('#', $uri) !== 0) {
$uri = Uri::to($uri);
}
if ($title == '') {
$title = $uri;
}
$attributes['href'] = $uri;
return static::element('a', $title, $attributes);
}
示例4: array
<?php
echo $header;
?>
<form method="post" action="<?php
echo Uri::to('admin/posts/edit/' . $article->id);
?>
"
enctype="multipart/form-data" novalidate>
<input name="token" type="hidden" value="<?php
echo $token;
?>
">
<fieldset class="header">
<div class="wrap">
<?php
echo $messages;
?>
</div>
</fieldset>
<fieldset class="main">
<div class="wrap">
<?php
echo Form::text('title', Input::previous('title', $article->title), array('placeholder' => __('posts.title'), 'autocomplete' => 'off', 'autofocus' => 'true'));
?>
<?php
echo Form::textarea('html', Input::previous('html', $article->html), array('placeholder' => __('posts.content_explain'), 'class' => 'ckeditorgo'));
示例5: function
$vars['messages'] = Notify::read();
$vars['posts'] = $pagination;
$vars['category'] = $category;
$vars['categories'] = Category::sort('title')->get();
$vars['status'] = 'all';
return View::create('posts/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
});
/*
List posts by status and paginate through them
*/
Route::get(array('admin/posts/status/(:any)', 'admin/posts/status/(:any)/(:num)'), function ($status, $post = 1) {
$query = Post::where('status', '=', $status);
$perpage = Config::meta('posts_per_page');
$total = $query->count();
$posts = $query->sort('title')->take($perpage)->skip(($post - 1) * $perpage)->get();
$url = Uri::to('admin/posts/status');
$pagination = new Paginator($posts, $total, $post, $perpage, $url);
$vars['messages'] = Notify::read();
$vars['posts'] = $pagination;
$vars['status'] = $status;
$vars['categories'] = Category::sort('title')->get();
return View::create('posts/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
});
/*
Edit post
*/
Route::get('admin/posts/edit/(:num)', function ($id) {
$vars['messages'] = Notify::read();
$vars['token'] = Csrf::token();
$vars['article'] = Post::find($id);
$vars['page'] = Registry::get('posts_page');
示例6: __
?>
<hgroup class="wrap">
<h1><?php
echo __('extend.create_variable');
?>
</h1>
</hgroup>
<section class="wrap">
<?php
echo $messages;
?>
<form method="post" action="<?php
echo Uri::to('admin/extend/variables/add');
?>
" novalidate>
<input name="token" type="hidden" value="<?php
echo $token;
?>
">
<fieldset class="split">
<p>
<label><?php
echo __('extend.name');
?>
:</label>
<?php
示例7: asset
?>
"></script>
<script src="<?php
echo asset('anchor/views/assets/js/change-saver.js');
?>
"></script>
<script src="<?php
echo asset('anchor/views/assets/js/autosave.js');
?>
"></script>
<script>
$('textarea[name=markdown]').editor();
$('#pagetype').on('change', function() {
var $this = $(this);
$.post("<?php
echo Uri::to('admin/get_fields');
?>
", {
id: <?php
echo $page->id;
?>
,
pagetype: $this.val(),
token: "<?php
echo $token;
?>
"
}, function(res){
res = JSON.parse(res);
$('#extended-fields').html(res.html);
$('input[name="token"]').replaceWith(res.token);
示例8: base_url
function base_url($url = '')
{
return Uri::to($url);
}
示例9: __
echo $header;
?>
<hgroup class="wrap">
<h1><?php
echo __('extend.editing_custom_field', $field->label);
?>
</h1>
</hgroup>
<section class="wrap">
<form method="post" action="<?php
echo Uri::to('admin/extend/fields/edit/' . $field->id);
?>
" novalidate>
<input name="token" type="hidden" value="<?php
echo $token;
?>
">
<fieldset class="split">
<p>
<label for="label-type"><?php
echo __('extend.type');
?>
:</label>
<?php
示例10: array
<aside class="buttons">
<?php
echo Form::button(__('global.create'), array('class' => 'btn', 'type' => 'submit'));
?>
<?php
echo Html::link('admin/users', __('global.cancel'), array('class' => 'btn cancel blue'));
?>
</aside>
</form>
<?php
} else {
?>
<p>You do not have the required privileges to add users, you must be an Administrator. Please contact the Administrator of the site if you are supposed to have these privileges.</p>
<br><a class="btn" href="<?php
echo Uri::to('admin/users');
?>
">Go back</a>
<?php
}
?>
</section>
<script src="<?php
echo asset('anchor/views/assets/js/upload-fields.js');
?>
"></script>
<?php
echo $footer;
示例11: Paginator
$url = Uri::to('admin/pages');
$pagination = new Paginator($pages, $total, $page, $perpage, $url);
$vars['messages'] = Notify::read();
$vars['pages'] = $pagination;
$vars['status'] = 'all';
return View::create('pages/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
});
/*
List pages by status and paginate through them
*/
Route::get(array('admin/pages/status/(:any)', 'admin/pages/status/(:any)/(:num)'), function ($status, $page = 1) {
$query = Page::where('status', '=', $status);
$perpage = Config::meta('posts_per_page');
$total = $query->count();
$pages = $query->sort('title')->take($perpage)->skip(($page - 1) * $perpage)->get();
$url = Uri::to('admin/pages/status');
$pagination = new Paginator($pages, $total, $page, $perpage, $url);
$vars['messages'] = Notify::read();
$vars['pages'] = $pagination;
$vars['status'] = $status;
return View::create('pages/index', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer');
});
/*
Edit Page
*/
Route::get('admin/pages/edit/(:num)', function ($id) {
$vars['messages'] = Notify::read();
$vars['token'] = Csrf::token();
$vars['page'] = Page::find($id);
$vars['pages'] = Page::dropdown(array('exclude' => array($id), 'show_empty_option' => true));
$vars['statuses'] = array('published' => __('global.published'), 'draft' => __('global.draft'), 'archived' => __('global.archived'));
示例12: array
<?php
echo Form::text('user', $user, array('id' => 'label-user', 'autocapitalize' => 'off', 'autofocus' => 'true', 'placeholder' => __('users.username')));
?>
</p>
<p><label for="label-pass"><?php
echo __('users.password');
?>
:</label>
<?php
echo Form::password('pass', array('id' => 'pass', 'placeholder' => __('users.password'), 'autocomplete' => 'off'));
?>
</p>
<p class="buttons"><a href="<?php
echo Uri::to('admin/amnesia');
?>
"><?php
echo __('users.forgotten_password');
?>
</a>
<button type="submit"><?php
echo __('global.login');
?>
</button></p>
</fieldset>
</form>
</section>
<?php
示例13: comment_form_url
function comment_form_url()
{
return Uri::to(Uri::current());
}
示例14: array
<?php
echo $header;
?>
<form method="post" action="<?php
echo Uri::to('admin/pages/add');
?>
" enctype="multipart/form-data" novalidate>
<input name="token" type="hidden" value="<?php
echo $token;
?>
">
<fieldset class="header">
<div class="wrap">
<?php
echo $messages;
?>
<?php
echo Form::text('title', Input::previous('title'), array('placeholder' => __('pages.title'), 'autocomplete' => 'off', 'autofocus' => 'true'));
?>
<aside class="buttons">
<?php
echo Form::button(__('global.save'), array('type' => 'submit', 'class' => 'btn'));
?>
<?php
示例15: foreach
</nav>
</hgroup>
<section class="wrap">
<?php
echo $messages;
?>
<ul class="list">
<?php
foreach ($companies->results as $company) {
?>
<li>
<a href="<?php
echo Uri::to('admin/companies/edit/' . $company->id);
?>
">
<strong><?php
echo $company->title;
?>
</strong>
<span><?php
echo $company->slug;
?>
</span>
</li>
<?php
}
?>