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


PHP Url::make方法代碼示例

本文整理匯總了PHP中Url::make方法的典型用法代碼示例。如果您正苦於以下問題:PHP Url::make方法的具體用法?PHP Url::make怎麽用?PHP Url::make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Url的用法示例。


在下文中一共展示了Url::make方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: article_url

function article_url()
{
    if ($itm = IoC::resolve('article')) {
        $page = IoC::resolve('posts_page');
        return Url::make($page->slug . '/' . $itm->slug);
    }
    return '';
}
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:8,代碼來源:articles.php

示例2: login

 protected function login()
 {
     if (Router::$IS_AJAX || Router::$IS_IFRAME) {
         $this->renderError('請先登錄!');
     }
     $backUrl = Url::getCurrentUrl(array('back-url' => null));
     $url = Url::make('//uc.hqoj.net/login/', array('back-url' => $backUrl));
     Url::redirect($url);
 }
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:9,代碼來源:BaseController.class.php

示例3: generate

 public static function generate()
 {
     // create a dom xml object
     static::$document = new DOMDocument('1.0', 'UTF-8');
     // create our rss feed
     $rss = static::element('rss', null, array('version' => '2.0', 'xmlns:atom' => 'http://www.w3.org/2005/Atom'));
     static::$document->appendChild($rss);
     // create channel
     $channel = static::element('channel');
     $rss->appendChild($channel);
     // title
     $title = static::element('title', Config::get('metadata.sitename'));
     $channel->appendChild($title);
     // link
     $url = 'http://' . $_SERVER['HTTP_HOST'];
     $link = static::element('link', $url);
     $channel->appendChild($link);
     // description
     $description = static::element('description', Config::get('metadata.description'));
     $channel->appendChild($description);
     // laguage
     // http://www.rssboard.org/rss-language-codes
     $language = static::element('language', Config::get('application.language', 'en'));
     $channel->appendChild($language);
     $ttl = static::element('ttl', 60);
     $channel->appendChild($ttl);
     $docs = static::element('docs', 'http://blogs.law.harvard.edu/tech/rss');
     $channel->appendChild($docs);
     $copyright = static::element('copyright', Config::get('metadata.sitename'));
     $channel->appendChild($copyright);
     // atom self link
     $atom = static::element('atom:link', null, array('href' => $url, 'rel' => 'self', 'type' => 'application/rss+xml'));
     $channel->appendChild($atom);
     // articles
     $params = array('status' => 'published', 'sortby' => 'id', 'sortmode' => 'desc');
     foreach (Posts::list_all($params) as $post) {
         $item = static::element('item');
         $channel->appendChild($item);
         // title
         $title = static::element('title', $post->title);
         $item->appendChild($title);
         // link
         $url = 'http://' . $_SERVER['HTTP_HOST'] . Url::make(IoC::resolve('posts_page')->slug . '/' . $post->slug);
         $link = static::element('link', $url);
         $item->appendChild($link);
         // description
         $description = static::element('description', $post->description);
         $item->appendChild($description);
         // date
         $date = static::element('pubDate', date(DATE_RSS, $post->created));
         $item->appendChild($date);
     }
     // dump xml tree
     return static::$document->saveXML();
 }
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:55,代碼來源:rss.php

示例4: extend

 public static function extend($post)
 {
     if (is_array($post)) {
         $posts = array();
         foreach ($post as $itm) {
             $posts[] = static::extend($itm);
         }
         return $posts;
     }
     if (is_object($post)) {
         $page = IoC::resolve('posts_page');
         $post->url = Url::make($page->slug . '/' . $post->slug);
         return $post;
     }
     return false;
 }
開發者ID:rubenvincenten,項目名稱:anchor-site,代碼行數:16,代碼來源:posts.php

示例5: extend

 public static function extend($page)
 {
     if (is_array($page)) {
         $pages = array();
         foreach ($page as $itm) {
             $pages[] = static::extend($itm);
         }
         return $pages;
     }
     if (is_object($page)) {
         $uri = Request::uri();
         $page->url = Url::make($page->slug);
         $page->active = strlen($uri) ? strpos($uri, $page->slug) !== false : $page->slug === 'posts';
         return $page;
     }
     return false;
 }
開發者ID:rubenvincenten,項目名稱:anchor-site,代碼行數:17,代碼來源:pages.php

示例6: generate

 public static function generate()
 {
     // create a dom xml object
     static::$document = new DOMDocument('1.0', 'UTF-8');
     // create our rss feed
     $rss = static::element('rss', null, array('version' => '2.0'));
     static::$document->appendChild($rss);
     // create channel
     $channel = static::element('channel');
     $rss->appendChild($channel);
     // title
     $title = static::element('title', Config::get('metadata.sitename'));
     $channel->appendChild($title);
     // link
     $link = static::element('link', 'http://' . $_SERVER['HTTP_HOST']);
     $channel->appendChild($link);
     // description
     $description = static::element('description', Config::get('metadata.description'));
     $channel->appendChild($description);
     // articles
     $params = array('status' => 'published', 'sortby' => 'id', 'sortmode' => 'desc');
     foreach (Posts::list_all($params) as $post) {
         $item = static::element('item');
         $channel->appendChild($item);
         // title
         $title = static::element('title', $post->title);
         $item->appendChild($title);
         // link
         $url = 'http://' . $_SERVER['HTTP_HOST'] . Url::make(IoC::resolve('posts_page')->slug . '/' . $post->slug);
         $link = static::element('link', $url);
         $item->appendChild($link);
         // description
         $description = static::element('description', $post->description);
         $item->appendChild($description);
         // date
         $date = static::element('pubDate', date(DATE_RSS, $post->created));
         $item->appendChild($date);
     }
     // dump xml tree
     return static::$document->saveXML();
 }
開發者ID:reqshark,項目名稱:anchor-cms,代碼行數:41,代碼來源:rss.php

示例7: extend

 public static function extend($page)
 {
     if (is_array($page)) {
         $pages = array();
         foreach ($page as $itm) {
             $pages[] = static::extend($itm);
         }
         return $pages;
     }
     if (is_object($page)) {
         $uri = Request::uri();
         $page->url = Url::make($page->slug);
         $page->active = false;
         if ($current = IoC::resolve('page')) {
             if ($current->id == $page->id) {
                 $page->active = true;
             }
         }
         return $page;
     }
     return false;
 }
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:22,代碼來源:pages.php

示例8: admin_url

			
			<a href="<?php 
echo admin_url('pages');
?>
">Return to pages</a>
		</p>
	</form>

</section>

<aside id="sidebar">
	<h2>Editing</h2>
	<em>Some useful links.</em>
	<ul>
		<li><a href="<?php 
echo Url::make($page->slug);
?>
">View this page on your site</a></li>
	</ul>
</aside>

<script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"></script>
<script>window.MooTools || document.write('<script src="<?php 
echo theme_url('assets/js/mootools.js');
?>
"><\/script>');</script>
<script src="<?php 
echo theme_url('assets/js/helpers.js');
?>
"></script>
<script>
開發者ID:reqshark,項目名稱:anchor-cms,代碼行數:30,代碼來源:edit.php

示例9: redirectIdioma

 public static function redirectIdioma($idioma)
 {
     Response::setRedirect(Url::make($idioma));
 }
開發者ID:joksnet,項目名稱:php-old,代碼行數:4,代碼來源:Url.php

示例10: recover_password

 public static function recover_password()
 {
     $post = Input::post(array('email'));
     $errors = array();
     if (filter_var($post['email'], FILTER_VALIDATE_EMAIL) === false) {
         $errors[] = 'Please enter a valid email address';
     } else {
         if (($user = static::find(array('email' => $post['email']))) === false) {
             $errors[] = 'Account not found';
         }
     }
     if (count($errors)) {
         Notifications::set('error', $errors);
         return false;
     }
     $hash = hash('md5', $user->id . $user->email . $user->password);
     $link = Url::build(array('path' => Url::make('admin/users/reset/' . $hash)));
     $subject = '[' . Config::get('metadata.sitename') . '] Password Reset';
     $plain = 'You have requested to reset your password. To continue follow the link below. ' . $link;
     $headers = array('From' => 'no-reply@' . Input::server('http_host'));
     Email::send($user->email, $subject, $plain, $headers);
     Notifications::set('notice', 'We have sent you an email to confirm your password change.');
     return true;
 }
開發者ID:rubenvincenten,項目名稱:anchor-site,代碼行數:24,代碼來源:users.php

示例11: redirect

 public static function redirect($url)
 {
     static::header('Location', Url::make($url));
     static::$status = 302;
     static::$content = '';
 }
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:6,代碼來源:response.php

示例12: foreach

			<?php 
if (($user = Users::authed()) !== false) {
    ?>
			<nav>
				<ul>
					<?php 
    foreach (admin_menu() as $title => $url) {
        ?>
					<li <?php 
        if (strpos(Url::current(), $url) !== false) {
            echo 'class="active"';
        }
        ?>
>
						<a href="<?php 
        echo Url::make($url);
        ?>
"><?php 
        echo __('common.' . $title, $title);
        ?>
</a>
					</li>
					<?php 
    }
    ?>
				</ul>
			</nav>

			<p><?php 
    echo __('common.logged_in_as', 'Logged in as');
    ?>
開發者ID:nathggns,項目名稱:anchor-cms,代碼行數:31,代碼來源:header.php

示例13: admin_url

function admin_url($url = '')
{
    return Url::make(Config::get('application.admin_folder') . '/' . ltrim($url, '/'));
}
開發者ID:reqshark,項目名稱:anchor-cms,代碼行數:4,代碼來源:functions.php

示例14: getStatusUrl

 public static function getStatusUrl($username, $remote, $problemCode, $result)
 {
     $url = Url::make('/status_list/', array('username' => $username, 'remote' => $remote, 'problem-code' => $problemCode, 'result' => $result));
     return $url;
 }
開發者ID:aozhongxu,項目名稱:web_hqoj,代碼行數:5,代碼來源:OjCommonHelper.class.php

示例15: admin_url

			<button name="delete" type="submit">Delete</button>
			<a href="<?php 
echo admin_url('posts');
?>
">Return to posts</a>
		</p>
		
	</form>
</section>

<aside id="sidebar">
	<h2>Editing</h2>
	<em>Some useful links.</em>
	<ul>
		<li><a href="<?php 
echo Url::make($page->slug . '/' . $article->slug);
?>
">View this post on your site</a></li>
	</ul>
</aside>

<script src="//ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"></script>
<script>window.MooTools || document.write('<script src="<?php 
echo theme_url('assets/js/mootools.js');
?>
"><\/script>');</script>
<script src="<?php 
echo theme_url('assets/js/helpers.js');
?>
"></script>
<script src="<?php 
開發者ID:rubenvincenten,項目名稱:anchor-site,代碼行數:31,代碼來源:edit.php


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