當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Uri::to方法代碼示例

本文整理匯總了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'));
 }
開發者ID:pepfi,項目名稱:anchor-cms,代碼行數:7,代碼來源:company.php

示例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'));
 }
開發者ID:gautamkrishnar,項目名稱:Anchor-CMS-openshift-quickstart,代碼行數:7,代碼來源:user.php

示例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);
 }
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:11,代碼來源:html.php

示例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'));
開發者ID:Rictus,項目名稱:CMS_Prod,代碼行數:31,代碼來源:edit.php

示例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');
開發者ID:pepfi,項目名稱:anchor-cms,代碼行數:31,代碼來源:posts.php

示例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 
開發者ID:gautamkrishnar,項目名稱:Anchor-CMS-openshift-quickstart,代碼行數:31,代碼來源:add.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);
開發者ID:Rictus,項目名稱:CMS_Prod,代碼行數:31,代碼來源:edit.php

示例8: base_url

function base_url($url = '')
{
    return Uri::to($url);
}
開發者ID:biggtfish,項目名稱:anchor-cms,代碼行數:4,代碼來源:helpers.php

示例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 
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:30,代碼來源:edit.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;
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:30,代碼來源:add.php

示例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'));
開發者ID:gautamkrishnar,項目名稱:Anchor-CMS-openshift-quickstart,代碼行數:31,代碼來源:pages.php

示例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 
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:31,代碼來源:login.php

示例13: comment_form_url

function comment_form_url()
{
    return Uri::to(Uri::current());
}
開發者ID:silviuu,項目名稱:blg,代碼行數:4,代碼來源:comments.php

示例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 
開發者ID:Rictus,項目名稱:CMS_Prod,代碼行數:31,代碼來源:add.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 
}
?>
開發者ID:pepfi,項目名稱:anchor-cms,代碼行數:31,代碼來源:index.php


注:本文中的Uri::to方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。