当前位置: 首页>>代码示例>>PHP>>正文


PHP URL::get方法代码示例

本文整理汇总了PHP中URL::get方法的典型用法代码示例。如果您正苦于以下问题:PHP URL::get方法的具体用法?PHP URL::get怎么用?PHP URL::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在URL的用法示例。


在下文中一共展示了URL::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($id = false)
 {
     parent::__construct();
     $this->add("sections");
     $this->name = "form_category";
     $this->enctype = "multipart/form-data";
     $this->action = URL::current();
     $this->sections = SectionDB::getAll();
     if (!$id) {
         $this->text("title", "Название:", FormProcessor::getSessionData("title"));
         $this->textarea("meta_desc", "Описание:", FormProcessor::getSessionData("meta_desc"));
         $this->textarea("meta_key", "Ключевые слова:", FormProcessor::getSessionData("meta_key"));
         $this->text("alias", "ЧПУ ссылка", FormProcessor::getSessionData("alias"));
         $this->checkbox("show", "Показывать:", "1");
         $this->submit("insert_category", "Сохранить");
     } else {
         $this->add("section_id");
         $this->hidden("id", $id);
         $obj = new CategoryDB();
         $obj->load($id);
         $this->text("title", "Название:", $obj->title);
         $this->textarea("meta_desc", "Описание:", $obj->meta_desc);
         $this->textarea("meta_key", "Ключевые слова:", $obj->meta_key);
         $link = URL::get("category", "", array("id" => $id), true, "", false);
         $alias = SefDB::getAliasOnLink($link);
         $this->text("alias", "ЧПУ ссылка", $alias);
         $this->checkbox("show", "Показывать:", "1", "", (int) $obj->show);
         $this->submit("update_category", "Сохранить");
         $this->section_id = $obj->section_id;
     }
 }
开发者ID:kuaa59,项目名称:www,代码行数:31,代码来源:formcategory_class.php

示例2: filter_adminhandler_post_loadplugins_main_menu

 /**
  * Add the Live Help page to the admin menu
  *
  * @param array $menus The main admin menu
  * @return array The altered admin menu
  */
 function filter_adminhandler_post_loadplugins_main_menu($menus)
 {
     if (User::identify()->can('LiveHelp')) {
         $menus['livehelp'] = array('url' => URL::get('admin', 'page=livehelp'), 'title' => _t('Live Help'), 'text' => _t('Live Help'), 'selected' => false);
     }
     return $menus;
 }
开发者ID:habari-extras,项目名称:livehelp,代码行数:13,代码来源:livehelp.plugin.php

示例3: theme_page_dropdown

 /**
  * Build a selection input of paginated paths to be used for pagination.
  *
  * @param string The RewriteRule name used to build the links.
  * @param array Various settings used by the method and the RewriteRule.
  * @return string Collection of paginated URLs built by the RewriteRule.
  */
 function theme_page_dropdown($theme, $rr_name = NULL, $settings = array())
 {
     $output = "";
     $current = $theme->page;
     $items_per_page = isset($theme->posts->get_param_cache['limit']) ? $theme->posts->get_param_cache['limit'] : Options::get('pagination');
     $total = Utils::archive_pages($theme->posts->count_all(), $items_per_page);
     // Make sure the current page is valid
     if ($current > $total) {
         $current = $total;
     } else {
         if ($current < 1) {
             $current = 1;
         }
     }
     $output = '<select onchange="location.href=options[selectedIndex].value">';
     for ($page = 1; $page < $total; ++$page) {
         $settings['page'] = $page;
         $caption = $page == $current ? $current : $page;
         // Build the path using the supplied $settings and the found RewriteRules arguments.
         $url = URL::get($rr_name, $settings, false, false, false);
         // Build the select option.
         $output .= '<option value="' . $url . '"' . ($page == $current ? ' selected="selected"' : '') . '>' . $caption . '</option>' . "\n";
     }
     $output .= "</select>";
     return $output;
 }
开发者ID:habari-extras,项目名称:page_dropdown,代码行数:33,代码来源:page_dropdown.plugin.php

示例4: postAdminHandling

 private function postAdminHandling($view_id, $gallery_id)
 {
     $this->link_update = URL::get("update", "admin", array("view" => "imggallery", "view_id" => $view_id, "gallery_id" => $gallery_id, "img_id" => $this->id));
     $this->link_delete = URL::get("delete", "admin", array("view" => "imggallery", "view_id" => $view_id, "gallery_id" => $gallery_id, "img_id" => $this->id));
     $this->img = Config::DIR_IMG_IMGGALLERY . $this->img;
     return true;
 }
开发者ID:kuaa59,项目名称:www,代码行数:7,代码来源:imggallerydb_class.php

示例5: action_admin_header

    function action_admin_header()
    {
        $url = URL::get('auth_ajax', 'context=extendedlog');
        $script = <<<SCRIPT
\$(function(){
\tvar initi = itemManage.initItems;
\titemManage.initItems = function(){
\t\tiniti();
\t\t\$('.page-logs .manage .item .less,.page-logs .manage .item .message.minor').hide();
\t\t\$('.page-logs .manage .item .more').show().css({clear: 'both', marginLeft: '40px', fontWeight: 'bold', width: '100%'});
\t\t\$('.page-logs .manage .item').click(function(){
\t\t\t\$('.extendedlog').remove();
\t\t\t\$(this).after('<div class="extendedlog"><div class="textarea" style="white-space:pre;font-family:consolas,courier new,monospace;border:1px solid #999;padding:20px;margin:20px 0px;height:100px;overflow-y:auto;">Loading...</div></div>');
\t\t\t\$('.extendedlog .textarea').resizeable();
\t\t\t\$.post(
\t\t\t\t'{$url}',
\t\t\t\t{
\t\t\t\t\tlog_id: \$('.checkbox input', \$(this)).attr('id').match(/\\[([0-9]+)\\]/)[1]
\t\t\t\t},
\t\t\t\tfunction(result){
\t\t\t\t\t\$('.extendedlog .textarea').html(result)
\t\t\t\t}
\t\t\t);
\t\t});
\t}
});
SCRIPT;
        Stack::add('admin_header_javascript', $script, 'extendedlog', array('jquery', 'admin'));
    }
开发者ID:habari-extras,项目名称:extendedlog,代码行数:29,代码来源:extendedlog.plugin.php

示例6: action_plugin_act_plaintext

    /**
     * Respond to the URL that was created
     * Determine the post that was supposed to be displayed, and show it in raw
     * @params array $handlervars An array of values passed in from the URL requested
     */
    function action_plugin_act_plaintext($handlervars)
    {
        $activetheme = Themes::create();
        $user_filters = array('fetch_fn' => 'get_row', 'limit' => 1);
        $page_key = array_search('page', $activetheme->valid_filters);
        unset($activetheme->valid_filters[$page_key]);
        $user_filters = Plugins::filter('template_user_filters', $user_filters);
        $user_filters = array_intersect_key($user_filters, array_flip($activetheme->valid_filters));
        $where_filters = Controller::get_handler()->handler_vars->filter_keys($activetheme->valid_filters);
        $where_filters = $where_filters->merge($user_filters);
        $where_filters = Plugins::filter('template_where_filters', $where_filters);
        $post = Posts::get($where_filters);
        $current_url = URL::get();
        $created_at = $post->pubdate->get();
        header('Content-type: text/plain; charset=utf-8');
        echo <<<HERE
# {$post->title}

  By {$post->author->displayname}
  <{$current_url}>
  {$created_at}
\t
{$post->content}
HERE;
        exit;
    }
开发者ID:habari-extras,项目名称:plaintext,代码行数:31,代码来源:plaintext.plugin.php

示例7: action_template_footer

	/**
	 * Ouputs the default menu in the template footer, and runs the 'habmin_bar' plugin filter.
	 * You can add menu items via the filter. See the 'filter_habminbar' method for
	 * an example.
	 */
	public function action_template_footer()
	{
		if ( User::identify()->loggedin ) {
			$bar = '<div id="habminbar"><div>';
			$bar.= '<div id="habminbar-name"><a href="' . Options::get('base_url') . '">' . Options::get('title') . '</a></div>';
			$bar.= '<ul>';

			$menu = array();
			$menu['dashboard']= array( 'Dashboard', URL::get( 'admin', 'page=dashboard' ), "view the admin dashboard" );
			$menu['write']= array( 'Write', URL::get( 'admin', 'page=publish' ), "create a new entry" );
			$menu['option']= array( 'Options', URL::get( 'admin', 'page=options' ), "configure site options" );
			$menu['comment']= array( 'Moderate', URL::get( 'admin', 'page=comments' ),"moderate comments" );
			$menu['user']= array( 'Users', URL::get( 'admin', 'page=users' ), "administer users" );
			$menu['plugin']= array( 'Plugins', URL::get( 'admin', 'page=plugins' ), "activate and configure plugins" );
			$menu['theme']= array( 'Themes', URL::get( 'admin', 'page=themes' ), "select a theme" );

			$menu = Plugins::filter( 'habminbar', $menu );

			$menu['logout']= array( 'Logout', URL::get( 'user', 'page=logout' ), "logout" );

			foreach ( $menu as $name => $item ) {
				list( $label, $url, $tooltip )= array_pad( $item, 3, "" );
				$bar.= "\n\t<li><a href=\"$url\" class=\"$name\"" .
				( ( $tooltip ) ? " title=\"$tooltip\"" : "" ) .">$label</a></li>";
			}
			$bar.= '</ul><br style="clear:both;" /></div></div>';

			echo $bar;
		}
	}
开发者ID:nerdfiles,项目名称:habari_boilerplate,代码行数:35,代码来源:habminbar.plugin.php

示例8: act

 public function act($action)
 {
     if ($action == 'atom_feed') {
         if (!isset($this->handler_vars['index'])) {
             $this->handler_vars['index'] = 1;
         }
         $url = URL::get('atom_feed', $this->handler_vars, false);
     } else {
         if ($action == 'display_entry') {
             if (isset($this->handler_vars['slug'])) {
                 $post = Post::get(array('slug' => $this->handler_vars['slug']));
                 // don't assume that a slug means a valid post
                 if ($post !== false) {
                     $url = URL::get('display_entry', $post, false);
                 } else {
                     $url = URL::get('display_404', $this->handler_vars->getArrayCopy(), false);
                 }
             } else {
                 $post = Post::get($this->handler_vars->getArrayCopy());
                 if ($post !== false) {
                     $url = $post->permalink;
                 } else {
                     $url = URL::get('display_404', $this->handler_vars->getArrayCopy(), false);
                 }
             }
         } else {
             $url = URL::get($action, $this->handler_vars->getArrayCopy(), false);
         }
     }
     header('Location: ' . $url, true, 301);
 }
开发者ID:habari-extras,项目名称:route301,代码行数:31,代码来源:route301.plugin.php

示例9: theme_monthly_archives_links_list

 public function theme_monthly_archives_links_list($theme, $full_names = TRUE, $show_counts = TRUE, $type = 'entry', $status = 'published')
 {
     $results = Posts::get(array('content_type' => $type, 'status' => $status, 'month_cts' => 1));
     $archives[] = '';
     foreach ($results as $result) {
         // add leading zeros
         $result->month = str_pad($result->month, 2, 0, STR_PAD_LEFT);
         // what format do we want to show the month in?
         if ($full_names) {
             $display_month = HabariDateTime::date_create()->set_date($result->year, $result->month, 1)->get('F');
         } else {
             $display_month = HabariDateTime::date_create()->set_date($result->year, $result->month, 1)->get('M');
         }
         // do we want to show the count of posts?
         if ($show_counts) {
             $count = ' (' . $result->ct . ')';
         } else {
             $count = '';
         }
         $archives[] = '<li>';
         $archives[] = '<a href="' . URL::get('display_entries_by_date', array('year' => $result->year, 'month' => $result->month)) . '" title="View entries in ' . $display_month . '/' . $result->year . '">' . $display_month . ' ' . $result->year . ' ' . $count . '</a>';
         $archives[] = '</li>';
     }
     $archives[] = '';
     return implode("\n", $archives);
 }
开发者ID:habari-extras,项目名称:naturalpower,代码行数:26,代码来源:theme.php

示例10: post_import

 /**
  * Handles the submission of the import form, importing data from a WordPress database.
  * This function should probably be broken into an importer class, since it is WordPress-specific.
  */
 public function post_import()
 {
     if (!isset($_POST['importer'])) {
         Utils::redirect(URL::get('admin', 'page=import'));
     }
     $this->get_import();
 }
开发者ID:wwxgitcat,项目名称:habari,代码行数:11,代码来源:adminimporthandler.php

示例11: __construct

 function __construct()
 {
     $this->fPass = new Models_Forgotpass();
     if (URL::getQueryParametr('logout')) {
         User::logout();
     }
     if (User::isAuth()) {
         MG::redirect('/personal');
     }
     if (isset($_POST['registration'])) {
         // Если данные введены верно.
         if (!$this->unValidForm()) {
             USER::add($this->userData);
             $message = '<span class="succes-reg">Вы успешно зарегистрировались! Для активации пользователя Вам необходимо перейти по ссылке высланной на Ваш электронный адрес <strong>' . $this->userData['email'] . '</strong></span>';
             $form = false;
             // Рассылаем письма со ссылкой для подтверждения регистрации.
             $this->_sendActivationMail($this->userData['email']);
             unset($_POST);
         } else {
             $error = $this->error;
             $form = true;
         }
     } else {
         // Если пользователь не авторизован.
         if (!User::isAuth() && (isset($_POST['email']) || isset($_POST['pass']))) {
             if (!User::auth(URL::get('email'), URL::get('pass'))) {
                 $error = '<span class="msgError">' . 'Неправильная пара email-пароль! Авторизоваться не удалось.' . '</span>';
             } else {
                 $this->successfulLogon();
             }
         }
     }
     $data = array('meta_title' => 'Авторизация', 'msgError' => $error, 'message' => $message, 'meta_keywords' => !empty($model->currentCategory['meta_keywords']) ? $model->currentCategory['meta_keywords'] : "Авторизация,вход, войти в личный кабинет", 'meta_desc' => !empty($model->currentCategory['meta_desc']) ? $model->currentCategory['meta_desc'] : "Авторизуйтесь на сайте и вы получите дополнительные возможности, недоступные для обычных пользователей.");
     $this->data = $data;
 }
开发者ID:WinGood,项目名称:24karcher,代码行数:35,代码来源:enter.php

示例12: __construct

 public function __construct($view, $param)
 {
     parent::__construct();
     $this->add("hornav");
     $this->add("n");
     $this->name = "form_viewgallery";
     $this->enctype = "multipart/form-data";
     $this->action = URL::current();
     $viewgallery_obj = new ViewgalleryDB();
     $viewgallery_obj->load($param["view_id"]);
     $this->hornav = new Hornav();
     $this->hornav->addData("Админпанель", URL::get("menu", "admin"));
     $this->hornav->addData("Галерея", URL::get("viewgallery", "admin"));
     $this->hornav->addData($viewgallery_obj->title, URL::get("listgallery", "admin", array("view_id" => $param["view_id"])));
     if (!$param["gallery_id"]) {
         $this->hornav->addData("Добавить");
         $this->text("title", "Название:", FormProcessor::getSessionData("title"));
         $this->file("img", "Картинка:");
         $this->textarea("meta_desc", "Описание:", FormProcessor::getSessionData("meta_desc"));
         $this->textarea("meta_key", "Ключевые слова:", FormProcessor::getSessionData("meta_key"));
         $this->submit("insert_listgallery", "Сохранить");
     } else {
         $this->hidden("id", $param["gallery_id"]);
         $gallery_obj = new GalleryDB();
         $gallery_obj->load($param["gallery_id"]);
         $this->hornav->addData("Изменить");
         $this->text("title", "Название:", $gallery_obj->title);
         $this->file("img", "Картинка:");
         $this->textarea("meta_desc", "Описание:", $gallery_obj->meta_desc);
         $this->textarea("meta_key", "Ключевые слова:", $gallery_obj->meta_key);
         $this->submit("update_listgallery", "Сохранить");
     }
 }
开发者ID:kuaa59,项目名称:www,代码行数:33,代码来源:formlistgallery_class.php

示例13: action_form_publish

 public function action_form_publish($form, $post)
 {
     $selector = $form->append('wrapper', 'type_selector');
     $selector->class = 'container';
     // Utils::debug( 'bob' );
     if (Controller::get_var('to_type') != NULL && $post->content_type != Controller::get_var('to_type')) {
         /* set type */
         $post->content_type = Post::type(Controller::get_var('to_type'));
         $post->update();
         Utils::redirect(URL::get('admin', 'page=publish&id=' . $post->id));
         // Refresh view
     }
     foreach (Post::list_active_post_types() as $type) {
         if ($type != 0) {
             if ($post->id == 0) {
                 $url = URL::get('admin', 'page=publish&content_type=' . Post::type_name($type));
             } else {
                 $url = URL::get('admin', 'page=publish&to_type=' . Post::type_name($type) . '&id=' . $post->id);
             }
             $html = '<a href="' . $url . '"';
             if (Post::type_name($type) == $post->content_type || $type == $post->content_type) {
                 $html .= ' class="active"';
             }
             $html .= '>' . Post::type_name($type) . '</a>';
             $selector->append('static', 'type_selector_' . $type, $html);
         }
     }
     $selector->move_before($selector, $form);
     return $form;
 }
开发者ID:habari-extras,项目名称:supertypes,代码行数:30,代码来源:supertypes.plugin.php

示例14: postAdminHandling

 private function postAdminHandling()
 {
     $this->link_update = URL::get("update", "admin", array("view" => "collective", "view_id" => $this->id));
     $this->link_delete = URL::get("delete", "admin", array("view" => "collective", "view_id" => $this->id));
     $this->img = Config::DIR_IMG_COLLECTIVE . $this->img;
     return true;
 }
开发者ID:kuaa59,项目名称:www,代码行数:7,代码来源:collectivedb_class.php

示例15: action_block_content_draft_posts

 /**
  * Produce the content for the latest drafts block
  * @param Block $block The block object
  * @param Theme $theme The theme that the block will be output with
  */
 public function action_block_content_draft_posts($block, $theme)
 {
     $block->recent_posts = Posts::get(array('status' => 'draft', 'limit' => 8, 'user_id' => User::identify()->id));
     if (User::identify()->can('manage_entries')) {
         $block->link = URL::get('admin', array('page' => 'posts', 'status' => Post::status('draft'), 'user_id' => User::identify()->id));
     }
 }
开发者ID:habari-extras,项目名称:draftdashmodule,代码行数:12,代码来源:draftdashmodule.plugin.php


注:本文中的URL::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。