• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中url函数的典型用法代码示例。如果您正苦于以下问题:PHP url函数的具体用法?PHP url怎么用?PHP url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: actionModify

 function actionModify()
 {
     $id = (int) $this->_context->get('id');
     $rs = Account::find('user_id = ?', $id)->getOne();
     if (!$rs->id()) {
         return $this->msg($tip = '参数错误', url('manage::account'));
     }
     $form = Form_Common::createForm('', 'manage/profile');
     if ($this->_context->isPOST() && $form->validate($_POST)) {
         $post = $form->values();
         $user_mail = $post['user_mail'];
         $user_pass = $post['user_pass'];
         $is_locked = $post['is_locked'] ? '1' : '0';
         #dump($post);
         if ($user_pass) {
             $user_pass = sha1(md5('sike' . $post['user_pass'] . Q::ini('appini/secret_key')));
             $rs->user_pass;
         }
         $rs->user_mail = $user_mail;
         $rs->is_locked = $is_locked;
         $rs->save();
         return $this->msg($tip = '修改成功', url('manage::account/modify', array('id' => $id)));
     }
     $form->import($rs->toArray());
     $form->element('user_pass')->value = '';
     $form->element('is_locked')->checked = $rs->is_locked;
     #dump($form->element('is_locked'));
     $this->_view['form'] = $form;
     $this->_view['rs'] = $rs;
     $order = Order::find('user_id = ?', $id)->order('created DESC')->getAll();
     $this->_view['order'] = $order;
     $this->_view['_UDI'] = 'manage::account/index';
 }
开发者ID:xyz12810,项目名称:xiao3vpn,代码行数:33,代码来源:account_controller.php


示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param Request $request
  * @return Response
  * @internal param User $user
  * @internal param int $id
  */
 public function update(Request $request)
 {
     $this->validate($request, ['first_name' => 'required|max:255', 'last_name' => 'required|max:255', 'sex' => 'required', 'date_of_birth' => 'required']);
     $request['date_of_birth'] = Carbon::parse($request->get('date_of_birth'));
     Auth::user()->update($request->all());
     return redirect(url('/users/show'))->with('message', "Successfully updated Your info.");
 }
开发者ID:BinaryEye,项目名称:TheOneWhoCantBeNamed,代码行数:15,代码来源:UserController.php


示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->user()->admin) {
         return $next($request);
     }
     return new RedirectResponse(url('post/liste'));
 }
开发者ID:focuslife,项目名称:v0.1,代码行数:14,代码来源:Admin.php


示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check()) {
         return new RedirectResponse(url('/terrain'));
     }
     return $next($request);
 }
开发者ID:binaryk,项目名称:pedia,代码行数:14,代码来源:RedirectIfAuthenticated.php


示例5: settingsForm

 /**
  * Implements EntityReferenceHandler::settingsForm().
  */
 public static function settingsForm($field, $instance)
 {
     $view_settings = empty($field['settings']['handler_settings']['view']) ? '' : $field['settings']['handler_settings']['view'];
     $displays = views_get_applicable_views('entityreference display');
     // Filter views that list the entity type we want, and group the separate
     // displays by view.
     $entity_info = entity_get_info($field['settings']['target_type']);
     $options = array();
     foreach ($displays as $data) {
         list($view, $display_id) = $data;
         if ($view->base_table == $entity_info['base table']) {
             $options[$view->name . ':' . $display_id] = $view->name . ' - ' . $view->display[$display_id]->display_title;
         }
     }
     // The value of the 'view_and_display' select below will need to be split
     // into 'view_name' and 'view_display' in the final submitted values, so
     // we massage the data at validate time on the wrapping element (not
     // ideal).
     $form['view']['#element_validate'] = array('entityreference_view_settings_validate');
     if ($options) {
         $default = !empty($view_settings['view_name']) ? $view_settings['view_name'] . ':' . $view_settings['display_name'] : NULL;
         $form['view']['view_and_display'] = array('#type' => 'select', '#title' => t('View used to select the entities'), '#required' => TRUE, '#options' => $options, '#default_value' => $default, '#description' => '<p>' . t('Choose the view and display that select the entities that can be referenced.<br />Only views with a display of type "Entity Reference" are eligible.') . '</p>');
         $default = !empty($view_settings['args']) ? implode(', ', $view_settings['args']) : '';
         $form['view']['args'] = array('#type' => 'textfield', '#title' => t('View arguments'), '#default_value' => $default, '#required' => FALSE, '#description' => t('Provide a comma separated list of arguments to pass to the view.'));
     } else {
         $form['view']['no_view_help'] = array('#markup' => '<p>' . t('No eligible views were found. <a href="@create">Create a view</a> with an <em>Entity Reference</em> display, or add such a display to an <a href="@existing">existing view</a>.', array('@create' => url('admin/structure/views/add'), '@existing' => url('admin/structure/views'))) . '</p>');
     }
     return $form;
 }
开发者ID:TabulaData,项目名称:donl_d7,代码行数:32,代码来源:EntityReference_SelectionHandler_Views.class.php


示例6: getCurrentUrl

 /**
  * @return null|string
  */
 public function getCurrentUrl()
 {
     if (is_null($this->currentUrl)) {
         return url()->current();
     }
     return $this->currentUrl;
 }
开发者ID:kodicomponents,项目名称:navigation,代码行数:10,代码来源:Navigation.php


示例7: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, array &$form_state)
 {
     $form['#action'] = url('ajax-test/dialog');
     $form['description'] = array('#markup' => '<p>' . t("Ajax Form contents description.") . '</p>');
     $form['submit'] = array('#type' => 'submit', '#value' => t('Do it'));
     return $form;
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:10,代码来源:AjaxTestForm.php


示例8: bootstrap_sst_textfield

/**
 * Overrides theme_textfield().
 */
function bootstrap_sst_textfield($variables)
{
    $element = $variables['element'];
    $element['#attributes']['type'] = 'text';
    element_set_attributes($element, array('id', 'name', 'value', 'size', 'maxlength'));
    _form_set_class($element, array('form-text'));
    $output = '<input' . drupal_attributes($element['#attributes']) . ' />';
    $extra = '';
    if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
        drupal_add_library('system', 'drupal.autocomplete');
        $element['#attributes']['class'][] = 'form-autocomplete';
        $attributes = array();
        $attributes['type'] = 'hidden';
        $attributes['id'] = $element['#attributes']['id'] . '-autocomplete';
        $attributes['value'] = url($element['#autocomplete_path'], array('absolute' => TRUE));
        $attributes['disabled'] = 'disabled';
        $attributes['class'][] = 'autocomplete';
        // Uses icon for autocomplete "throbber".
        if ($icon = _bootstrap_icon('refresh')) {
            $output = '<div class="input-group">' . $output . '<span class="input-group-addon">' . $icon . '</span></div>';
        } else {
            $output = '<div class="input-group">' . $output . '<span class="input-group-addon">';
            // The throbber's background image must be set here because sites may not
            // be at the root of the domain (ie: /) and this value cannot be set via
            // CSS.
            $output .= '<span class="autocomplete-throbber" style="background-image:url(' . url('misc/throbber.gif') . ')"></span>';
            $output .= '</span></div>';
        }
        $extra = '<input' . drupal_attributes($attributes) . ' />';
    }
    return $output . $extra;
}
开发者ID:atssc-scdata,项目名称:bootstrap_sst,代码行数:35,代码来源:textfield.func.php


示例9: index

 public function index(Request $request)
 {
     $menus = app('menu')->where('parentid', '=', 0)->get();
     $leftMainUrl = url('/dash/left_main?menuid=');
     $params = ['menus' => $menus, 'left_main_url' => $leftMainUrl, 'crumb_url' => route('dash.crumbs')];
     return view('dash.index', $params);
 }
开发者ID:ruolinn,项目名称:lcms,代码行数:7,代码来源:DashController.php


示例10: __construct

 public function __construct($meta = array())
 {
     $this->label = t('Create new');
     $this->icon = 'glyphicon-new-window';
     $this->url = url(current_path(), array('action' => 'add'));
     parent::__construct($meta);
 }
开发者ID:moiseh,项目名称:codegen,代码行数:7,代码来源:Create.php


示例11: msg

 /**
  * $code 消息代码
  * $ctl 控制器
  * $ac 方法名
  * $reftime 跳转时间     
  */
 protected function msg($code, $ctl = '', $ac = '', $params = array(), $reftime = 3)
 {
     if (substr($code, 0, 1) == '-') {
         $this->_V->assign("msgtype", 0);
     } elseif (intval($code) > 10000 || intval($code) < 1000) {
         $this->_V->assign("msgtype", -1);
     } else {
         $this->_V->assign("msgtype", 1);
     }
     //生成导航
     $this->setNav(array('操作提示'));
     // 生成跳转URL
     if (empty($ctl)) {
         $goto = 'javascript:history.back();';
     } else {
         $ac = empty($ac) ? "Index" : $ac;
         $rurl = url($ctl, $ac, $params);
         $goto = "javascript:document.location.href='" . $rurl . "'";
     }
     $this->_V->assign("rurl", $rurl);
     $this->_V->assign("goto", $goto);
     $this->_V->assign("code", $code);
     $this->_V->assign("reftime", $reftime);
     $this->_V->display("msg.htm");
     exit;
 }
开发者ID:BGCX261,项目名称:zlskytakeorder-svn-to-git,代码行数:32,代码来源:Core.php


示例12: _collectionsForm

 /**
  * This returns the form for the collections.
  *
  * @return Zend_Form
  * @author Eric Rochester <[email protected]>
  **/
 protected function _collectionsForm()
 {
     $ctable = $this->_helper->db->getTable('Collection');
     $private = (int) get_option('solr_search_display_private_items');
     if ($private) {
         $collections = $ctable->findAll();
     } else {
         $collections = $ctable->findBy(array('public' => 1));
     }
     $form = new Zend_Form();
     $form->setAction(url('solr-search/collections'))->setMethod('post');
     $collbox = new Zend_Form_Element_MultiCheckbox('solrexclude');
     $form->addElement($collbox);
     foreach ($collections as $c) {
         $title = metadata($c, array('Dublin Core', 'Title'));
         $collbox->addMultiOption("{$c->id}", $title);
     }
     $etable = $this->_helper->db->getTable('SolrSearchExclude');
     $excludes = array();
     foreach ($etable->findAll() as $exclude) {
         $excludes[] = "{$exclude->collection_id}";
     }
     $collbox->setValue($excludes);
     $form->addElement('submit', 'Exclude');
     return $form;
 }
开发者ID:fitnycdigitalinitiatives,项目名称:SolrSearch,代码行数:32,代码来源:AdminController.php


示例13: fusion_core_initialize_theme_settings

/**
 * Initialize theme settings if needed
 */
function fusion_core_initialize_theme_settings($theme_name)
{
    $theme_settings = theme_get_settings($theme_name);
    if (is_null($theme_settings['theme_font_size']) || $theme_settings['rebuild_registry'] == 1) {
        // Rebuild theme registry & notify user
        if ($theme_settings['rebuild_registry'] == 1) {
            drupal_rebuild_theme_registry();
            drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
        }
        // Retrieve saved or site-wide theme settings
        $theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
        $settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
        // Skip toggle_node_info_ settings
        if (module_exists('node')) {
            foreach (node_get_types() as $type => $name) {
                unset($settings['toggle_node_info_' . $type]);
            }
        }
        // Retrieve default theme settings
        $defaults = fusion_core_default_theme_settings();
        // Set combined default & saved theme settings
        variable_set($theme_setting_name, array_merge($defaults, $settings));
        // Force theme settings refresh
        theme_get_setting('', TRUE);
    }
}
开发者ID:edchacon,项目名称:scratchpads,代码行数:29,代码来源:theme-settings.php


示例14: fusion_core_initialize_theme_settings

/**
 * Initialize theme settings if needed
 */
function fusion_core_initialize_theme_settings($theme_name)
{
    $theme_settings = theme_get_settings($theme_name);
    if (!isset($theme_settings['primary_menu_dropdown']) || $theme_settings['rebuild_registry'] == 1) {
        static $registry_rebuilt = false;
        // avoid multiple rebuilds per page
        // Rebuild theme registry & notify user
        if (isset($theme_settings['rebuild_registry']) && $theme_settings['rebuild_registry'] == 1 && !$registry_rebuilt) {
            drupal_rebuild_theme_registry();
            drupal_set_message(t('Theme registry rebuild completed. <a href="!link">Turn off</a> this feature for production websites.', array('!link' => url('admin/build/themes/settings/' . $GLOBALS['theme']))), 'warning');
            $registry_rebuilt = true;
        }
        // Retrieve saved or site-wide theme settings
        $theme_setting_name = str_replace('/', '_', 'theme_' . $theme_name . '_settings');
        $settings = variable_get($theme_setting_name, FALSE) ? theme_get_settings($theme_name) : theme_get_settings();
        // Skip toggle_node_info_ settings
        if (module_exists('node')) {
            foreach (node_get_types() as $type => $name) {
                unset($settings['toggle_node_info_' . $type]);
            }
        }
        // Combine default theme settings from .info file & theme-settings.php
        $theme_data = list_themes();
        // get theme data for all themes
        $info_theme_settings = $theme_name ? $theme_data[$theme_name]->info['settings'] : array();
        $defaults = array_merge(fusion_core_default_theme_settings(), $info_theme_settings);
        // Set combined default & saved theme settings
        variable_set($theme_setting_name, array_merge($defaults, $settings));
        // Force theme settings refresh
        theme_get_setting('', TRUE);
    }
}
开发者ID:victorkane,项目名称:adminescolar,代码行数:35,代码来源:theme-settings.php


示例15: index

 public function index(Request $request)
 {
     //处理分享次数加1
     $this->_shareTimes($request);
     $key = 'bonus_' . $this->user->getKey() . '_game';
     if (!Cache::has($key)) {
         $times = 1;
         Cache::forever($key, $times);
     } else {
         $times = intval(Cache::get($key, 0));
     }
     $this->_wechat = $this->getJsParameters();
     $this->_times = $times;
     $this->_uid = $this->user->getKey();
     $this->_type_id = 3;
     $this->_data = ['title' => '美猴捞红包', 'imgUrl' => 'plugins/img/m/monkey/monkey_main.jpg', 'desc' => '参加游戏,赢取猴子新年红包。'];
     $this->_bonus_cnt = ActivityBonus::where('uid', $this->user->getKey())->where('status', 0)->count();
     $stores_ids = $this->user->stores->pluck('id')->toArray();
     $stores_id = array_pop($stores_ids);
     $this->_share_url = url('m/home?sid=' . $stores_id . '&redirect_url=' . urlencode(url('m/game/loading') . '?uid=' . $this->_uid));
     $this->_save_put_code = str_random(40);
     $save_code_key = 'save_put_code_' . $this->user->getKey();
     session([$save_code_key => $this->_save_put_code]);
     //查找中奖列表
     $this->_bonus_list = ActivityBonus::with(['users'])->orderBy('created_at', 'desc')->take(9)->get();
     return $this->view('monkey::m.game');
 }
开发者ID:unionbt,项目名称:hanpaimall,代码行数:27,代码来源:GameController.php


示例16: getPublicUrl

 /**
  * Get the public path to the image
  * @param  string $path
  * @return string
  */
 public function getPublicUrl($path = '')
 {
     if (isset($this->options['public_url'])) {
         return $this->options['public_url'];
     }
     return url() . '/' . $this->addSlashes(self::DEFAULT_PUBLIC_PATH) . $path;
 }
开发者ID:nitin-vaghani,项目名称:bumble,代码行数:12,代码来源:ImageField.php


示例17: buildSiteMap

 /**
  * Build the Site Map
  */
 protected function buildSiteMap()
 {
     $postsInfo = $this->getPostsInfo();
     $dates = array_values($postsInfo);
     sort($dates);
     $lastmod = last($dates);
     $url = trim(url(), '/') . '/';
     $xml = [];
     $xml[] = '<?xml version="1.0" encoding="UTF-8"?' . '>';
     $xml[] = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
     $xml[] = '  <url>';
     $xml[] = "    <loc>{$url}</loc>";
     $xml[] = "    <lastmod>{$lastmod}</lastmod>";
     $xml[] = '    <changefreq>daily</changefreq>';
     $xml[] = '    <priority>0.8</priority>';
     $xml[] = '  </url>';
     foreach ($postsInfo as $slug => $lastmod) {
         $xml[] = '  <url>';
         $xml[] = "    <loc>{$url}home/{$slug}</loc>";
         $xml[] = "    <lastmod>{$lastmod}</lastmod>";
         $xml[] = "  </url>";
     }
     $xml[] = '</urlset>';
     return join("\n", $xml);
 }
开发者ID:canwonson,项目名称:myWeb,代码行数:28,代码来源:SiteMap.php


示例18: presentAvatarUrl

 /**
  * Get the user avatar.
  *
  * @return string
  */
 public function presentAvatarUrl()
 {
     if ($this->object->avatar) {
         return url($this->object->avatar);
     }
     return Gravatar::get($this->object->email);
 }
开发者ID:arasmit2453,项目名称:deployer,代码行数:12,代码来源:UserPresenter.php


示例19: showConnector

 public function showConnector()
 {
     $roots = $this->app->config->get('elfinder.roots', []);
     if (empty($roots)) {
         $dirs = (array) $this->app['config']->get('elfinder.dir', []);
         foreach ($dirs as $dir) {
             $roots[] = ['driver' => 'LocalFileSystem', 'path' => public_path($dir), 'URL' => url($dir), 'accessControl' => $this->app->config->get('elfinder.access')];
         }
         $disks = (array) $this->app['config']->get('elfinder.disks', []);
         foreach ($disks as $key => $root) {
             if (is_string($root)) {
                 $key = $root;
                 $root = [];
             }
             $disk = app('filesystem')->disk($key);
             if ($disk instanceof FilesystemAdapter) {
                 $defaults = ['driver' => 'Flysystem', 'filesystem' => $disk->getDriver(), 'alias' => $key];
                 $roots[] = array_merge($defaults, $root);
             }
         }
     }
     $opts = $this->app->config->get('elfinder.options', array());
     $opts = array_merge(['roots' => $roots], $opts);
     // run elFinder
     $connector = new Connector(new \elFinder($opts));
     $connector->run();
     return $connector->getResponse();
 }
开发者ID:avbrugen,项目名称:uace-laravel,代码行数:28,代码来源:ElfinderController.php


示例20: getOpenID

 /**
  *
  *
  * @return LightOpenID
  */
 public function getOpenID()
 {
     $OpenID = new LightOpenID();
     if ($url = Gdn::request()->get('url')) {
         if (!filter_var($url, FILTER_VALIDATE_URL)) {
             throw new Gdn_UserException(sprintf(t('ValidateUrl'), 'OpenID'), 400);
         }
         // Don't allow open ID on a non-standard scheme.
         $scheme = parse_url($url, PHP_URL_SCHEME);
         if (!in_array($scheme, array('http', 'https'))) {
             throw new Gdn_UserException(sprintf(t('ValidateUrl'), 'OpenID'), 400);
         }
         // Don't allow open ID on a non-standard port.
         $port = parse_url($url, PHP_URL_PORT);
         if ($port && !in_array($port, array(80, 8080, 443))) {
             throw new Gdn_UserException(t('OpenID is not allowed on non-standard ports.'));
         }
         $OpenID->identity = $url;
     }
     $Url = url('/entry/connect/openid', true);
     $UrlParts = explode('?', $Url);
     parse_str(val(1, $UrlParts, ''), $Query);
     $Query = array_merge($Query, arrayTranslate($_GET, array('display', 'Target')));
     $OpenID->returnUrl = $UrlParts[0] . '?' . http_build_query($Query);
     $OpenID->required = array('contact/email', 'namePerson/first', 'namePerson/last', 'pref/language');
     $this->EventArguments['OpenID'] = $OpenID;
     $this->fireEvent('GetOpenID');
     return $OpenID;
 }
开发者ID:korelstar,项目名称:vanilla,代码行数:34,代码来源:class.openid.plugin.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP url2html函数代码示例发布时间:2022-05-23
下一篇:
PHP urisprintf函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap