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


PHP Url::FromUri方法代码示例

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


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

示例1: buildConfigurationForm

 /**
  * {@inheritdoc}
  */
 public function buildConfigurationForm(array $form, FormStateInterface $form_state)
 {
     $cycle = \Drupal::service('library.discovery')->getLibraryByName('views_slideshow_cycle', 'jquery_cycle');
     if (!isset($cycle['js'][0]['data']) || !file_exists($cycle['js'][0]['data'])) {
         $form['views_slideshow_cycle']['no_cycle_js'] = array('#markup' => '<div style="color: red">' . t('You need to install the jQuery cycle plugin. Create a directory in libraries (which should be in your Drupal root folder, if not create the ... //#注:代码行过长, 已省略后续字符...
     }
     // Transition.
     $form['views_slideshow_cycle']['transition'] = array('#markup' => '<h2>' . t('Transition') . '</h2>');
     $effects = array('none' => 'none', 'blindX' => 'blindX', 'blindY' => 'blindY', 'blindZ' => 'blindZ', 'cover' => 'cover', 'curtainX' => 'curtainX', 'curtainY' => 'curtainY', 'fade' => 'fade', 'fadeZoom' => 'fadeZoom', 'growX' => 'growX', 'grow ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['effect'] = array('#type' => 'select', '#title' => t('Effect'), '#options' => $effects, '#default_value' => $this->getConfiguration()['effect'], '#description' => t('The transition effect that will be used to ch ... //#注:代码行过长, 已省略后续字符...
     // Transition advanced options.
     $form['views_slideshow_cycle']['transition_advanced'] = array('#type' => 'checkbox', '#title' => t('View Transition Advanced Options'), '#default_value' => $this->getConfiguration()['transition_advanced']);
     // Need to wrap this so it indents correctly.
     $form['views_slideshow_cycle']['transition_advanced_wrapper'] = array('#markup' => '<div class="vs-dependent">');
     $form['views_slideshow_cycle']['timeout'] = array('#type' => 'textfield', '#title' => t('Timer delay'), '#default_value' => $this->getConfiguration()['timeout'], '#description' => t('Amount of time in milliseconds between transitions. Set the ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['speed'] = array('#type' => 'textfield', '#title' => t('Speed'), '#default_value' => $this->getConfiguration()['speed'], '#description' => t('Time in milliseconds that each transition lasts. Numeric only!'), '#s ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['delay'] = array('#type' => 'textfield', '#title' => t('Initial slide delay offset'), '#default_value' => $this->getConfiguration()['delay'], '#description' => t('Amount of time in milliseconds for the first sli ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['sync'] = array('#type' => 'checkbox', '#title' => t('Sync'), '#default_value' => $this->getConfiguration()['sync'], '#description' => t('The sync option controls whether the slide transitions occur simultaneous ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['random'] = array('#type' => 'checkbox', '#title' => t('Random'), '#description' => t('This option controls the order items are displayed. The default setting, unselected, uses the views ordering. Selected will  ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['transition_advanced_wrapper_close'] = array('#markup' => '</div>');
     // Action.
     $form['views_slideshow_cycle']['action'] = array('#markup' => '<h2>' . t('Action') . '</h2>');
     $form['views_slideshow_cycle']['pause'] = array('#type' => 'checkbox', '#title' => t('Pause on hover'), '#default_value' => $this->getConfiguration()['pause'], '#description' => t('Pause when hovering on the slideshow image.'));
     $form['views_slideshow_cycle']['pause_on_click'] = array('#type' => 'checkbox', '#title' => t('Pause On Click'), '#default_value' => $this->getConfiguration()['pause_on_click'], '#description' => t('Pause when the slide is clicked.'));
     // Action Advanced Options.
     $form['views_slideshow_cycle']['action_advanced'] = array('#type' => 'checkbox', '#title' => t('View Action Advanced Options'), '#default_value' => $this->getConfiguration()['action_advanced']);
     // Need to wrap this so it indents correctly.
     $form['views_slideshow_cycle']['action_advanced_wrapper'] = array('#markup' => '<div class="vs-dependent">');
     $form['views_slideshow_cycle']['start_paused'] = array('#type' => 'checkbox', '#title' => t('Start Slideshow Paused'), '#default_value' => $this->getConfiguration()['start_paused'], '#description' => t('Start the slideshow in the paused state ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['remember_slide'] = array('#type' => 'checkbox', '#title' => t('Start On Last Slide Viewed'), '#default_value' => $this->getConfiguration()['remember_slide'], '#description' => t('When the user leaves a page wit ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['remember_slide_days'] = array('#type' => 'textfield', '#title' => t('Length of Time to Remember Last Slide'), '#default_value' => $this->getConfiguration()['remember_slide_days'], '#description' => t('The numbe ... //#注:代码行过长, 已省略后续字符...
     // @todo Check if there is a better way to detect optional libraries.
     $pause = \Drupal::service('library.discovery')->getLibraryByName('views_slideshow_cycle', 'jquery_pause');
     if (isset($pause['js'][0]['data']) && file_exists($pause['js'][0]['data'])) {
         $form['views_slideshow_cycle']['pause_in_middle'] = array('#type' => 'checkbox', '#title' => t('Pause The Slideshow In The Middle of the Transition'), '#default_value' => $this->getConfiguration()['pause_in_middle'], '#description' => t(' ... //#注:代码行过长, 已省略后续字符...
     }
     $form['views_slideshow_cycle']['pause_when_hidden'] = array('#type' => 'checkbox', '#title' => t('Pause When the Slideshow is Not Visible'), '#default_value' => $this->getConfiguration()['pause_when_hidden'], '#description' => t('When the sli ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['pause_when_hidden_type'] = array('#type' => 'select', '#title' => t('How to Calculate Amount of Slide that Needs to be Shown'), '#options' => array('full' => t('Entire slide'), 'vertical' => t('Set amount of ve ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['amount_allowed_visible'] = array('#type' => 'textfield', '#title' => t('Amount of Slide Needed to be Shown'), '#default_value' => $this->getConfiguration()['amount_allowed_visible'], '#description' => t("The am ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['#attached']['library'][] = 'views_slideshow_cycle/formoptions';
     $form['views_slideshow_cycle']['nowrap'] = array('#type' => 'checkbox', '#title' => t('End slideshow after last slide'), '#default_value' => $this->getConfiguration()['nowrap'], '#description' => t('If selected the slideshow will end when it  ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['fixed_height'] = array('#type' => 'checkbox', '#title' => t('Make the slide window height fit the largest slide'), '#default_value' => $this->getConfiguration()['fixed_height'], '#description' => t('If unselect ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['items_per_slide'] = array('#type' => 'textfield', '#title' => t('Items per slide'), '#default_value' => $this->getConfiguration()['items_per_slide'], '#description' => t('The number of items per slide'), '#size ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['wait_for_image_load'] = array('#type' => 'checkbox', '#title' => t('Wait for all the slide images to load'), '#default_value' => $this->getConfiguration()['wait_for_image_load'], '#description' => t('If selecte ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['wait_for_image_load_timeout'] = array('#type' => 'textfield', '#title' => t('Timeout'), '#default_value' => $this->getConfiguration()['wait_for_image_load_timeout'], '#description' => t('How long should it wait ... //#注:代码行过长, 已省略后续字符...
     // Need to wrap this so it indents correctly.
     $form['views_slideshow_cycle']['action_advanced_wrapper_close'] = array('#markup' => '</div>');
     // Internet Explorer Tweaks.
     $form['views_slideshow_cycle']['ie_tweaks'] = array('#markup' => '<h2>' . t('Internet Explorer Tweaks') . '</h2>');
     $form['views_slideshow_cycle']['cleartype'] = array('#type' => 'checkbox', '#title' => t('ClearType'), '#default_value' => $this->getConfiguration()['cleartype'], '#description' => t('Select if clearType corrections should be applied (for IE) ... //#注:代码行过长, 已省略后续字符...
     $form['views_slideshow_cycle']['cleartypenobg'] = array('#type' => 'checkbox', '#title' => t('ClearType Background'), '#default_value' => $this->getConfiguration()['cleartypenobg'], '#description' => t('Select to disable extra cleartype fixin ... //#注:代码行过长, 已省略后续字符...
     // Advanced Options.
     $form['views_slideshow_cycle']['advanced_options_header'] = array('#markup' => '<h2>' . t('jQuery Cycle Custom Options') . '</h2>');
     // @todo Check if there is a better way to detect optional libraries.
     $json2 = \Drupal::service('library.discovery')->getLibraryByName('views_slideshow_cycle', 'json2');
     if (!isset($json2['js'][0]['data']) || !file_exists($json2['js'][0]['data'])) {
         // @todo Check if there is a better way to create this target _blank link.
         $form['views_slideshow_cycle']['no_json_js'] = array('#markup' => '<div>' . t('To use the advanced options you need to download json2.js. You can do this by clicking the download button at <a href="https://github.com/douglascrockford/JSON ... //#注:代码行过长, 已省略后续字符...
     } else {
         // @todo Check if there is a better way to create this target _blank link.
         $form['views_slideshow_cycle']['advanced_options_info'] = array('#markup' => '<p>' . t('You can find a list of all the available options at <a href="http://malsup.com/jquery/cycle/options.html" target="_blank">http://malsup.com/jquery/cyc ... //#注:代码行过长, 已省略后续字符...
         // All the jquery cycle options according to
         // http://malsup.com/jquery/cycle/options.html
         $cycle_options = array(0 => 'Select One', 'activePagerClass' => 'activePagerClass', 'after' => 'after', 'allowPagerClickBubble' => 'allowPagerClickBubble', 'animIn' => 'animIn', 'animOut' => 'animOut', 'autostop' => 'autostop', 'autostopC ... //#注:代码行过长, 已省略后续字符...
         $form['views_slideshow_cycle']['advanced_options_choices'] = array('#type' => 'select', '#title' => t('Advanced Options'), '#options' => $cycle_options);
         $form['views_slideshow_cycle']['advanced_options_entry'] = array('#type' => 'textarea', '#title' => t('Advanced Option Value'), '#description' => t('It is important that you click the Update link when you make any changes to the options o ... //#注:代码行过长, 已省略后续字符...
         $form['views_slideshow_cycle']['advanced_options'] = array('#type' => 'textarea', '#default_value' => $this->getConfiguration()['advanced_options']);
         // @todo: Review how to create this table.
         $form['views_slideshow_cycle']['advanced_options_table'] = array('#markup' => '<table style="width: 400px; margin-left: 10px;" id="edit-style-options-views-slideshow-cycle-advanced-options-table"></table>');
     }
     return $form;
 }
开发者ID:badelas,项目名称:afroweb,代码行数:75,代码来源:Cycle.php


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