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


PHP View::element方法代码示例

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


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

示例1: formatter

 /**
  * Renders the given custom field.
  *
  * @param \Cake\View\View $view Instance of view class
  * @param \Field\Model\Entity\Field $field The field to be rendered
  * @return string HTML code
  */
 public static function formatter($view, $field)
 {
     switch ($field->viewModeSettings['formatter']) {
         case 'link':
             $out = $view->element('Field.FileField/display_link', compact('field'));
             break;
         case 'table':
             $out = $view->element('Field.FileField/display_table', compact('field'));
             break;
         case 'url':
         default:
             $out = $view->element('Field.FileField/display_url', compact('field'));
             break;
     }
     return $out;
 }
开发者ID:quickapps-plugins,项目名称:field,代码行数:23,代码来源:FileToolbox.php

示例2: _addBlock

 /**
  * Adding Hooked element to given target.
  *
  * @param $type
  * @param $blocks : Example:
  * [
  *  'Users/Users/index' => ['prepend' => false, 'element' => 'Bird.Actions/box1']
  *  'Users/index' => ['prepend' => false, 'element' => 'Bird.Actions/box1']
  *  'index' => ['prepend' => false, 'element' => 'Bird.Actions/box1']
  *  '*' => ['prepend' => false, 'element' => 'Bird.Actions/box1']
  * ]
  */
 protected function _addBlock($type, $blocks)
 {
     $plugin = $this->_View->request->param('plugin');
     $controller = $this->_View->request->param('controller');
     $action = $this->_View->request->param('action');
     $target = [$action, $controller . '/' . $action, $plugin . '/' . $controller . '/' . $action];
     $blockType = 'append';
     foreach ($blocks as $path => $block) {
         if ($path == '*' || in_array($path, $target)) {
             if ($block['prepend']) {
                 $blockType = 'prepend';
             }
             $this->_View->{$blockType}($type, $this->_View->element($block['element']));
         }
     }
 }
开发者ID:mohammadsaleh,项目名称:spider,代码行数:28,代码来源:PluginManagerEventHandler.php

示例3: render

 /**
  * {@inheritDoc}
  */
 public function render(View $view)
 {
     return $view->element('Captcha.ayah_render', ['ayah' => $this->_getLib()]);
 }
开发者ID:quickapps-plugins,项目名称:captcha,代码行数:7,代码来源:AyahAdapter.php

示例4: form

 /**
  * Create and render edit/add admin action.
  *
  * @return mixed
  */
 public function form()
 {
     return $this->_view->XmlForm->setName($this->getAlias())->setPath($this->_xmlFile())->setEntity($this->_entity)->setSets(['params'])->addTab('details', ['header' => __d('modules', 'Module details'), 'content' => $this->_view->element('Union/Modules.module_details')])->addTab('pages', ['header' => __d('modules', 'Binding to pages'), 'content' => $this->_view->Form->input('pages', ['default' => '*', 'label' => __d('modules', 'Show rules')])])->render(false);
 }
开发者ID:Cheren,项目名称:union,代码行数:9,代码来源:ModuleAbstract.php

示例5: render

 /**
  * {@inheritDoc}
  */
 public function render(View $view)
 {
     return $view->element('Captcha.recaptcha_render', ['siteKey' => $this->config('siteKey')]);
 }
开发者ID:quickapps-plugins,项目名称:captcha,代码行数:7,代码来源:RecaptchaAdapter.php

示例6: View

<?php

use Cake\View\View;
$view = new View();
return ['button' => '<button{{attrs}}>{{text}}</button>', 'checkbox' => '<input type="checkbox" name="{{name}}" value="{{value}}"{{attrs}}>', 'checkboxFormGroup' => '<div class="col-xs-12 col-sm-8 col-sm-offset-4 col-md-9 col-md-offset-3 checkbox">{{label}}</div>', 'checkboxWrapper' => '<div class="checkbox">{{label}}</div>', 'dateWidget' => '{{year}}{{month}}{{day}}{{hour}}{{minute}}{{second}}{{meridian}}', 'error' => '<div class="error-message col-xs-12 col-sm-8 col-md-9 col-sm-offset-4 col-md-offset-3 col-lg-10 col-lg-offset-2">{{content}}</div>', 'errorList' => '<ul>{{content}}</ul>', 'errorItem' => '<li>{{text}}</li>', 'file' => '<input type="file" name="{{name}}"{{attrs}}>', 'fieldset' => '<fieldset>{{content}}</fieldset>', 'formstart' => '<form{{attrs}}>', 'formend' => '</form>', 'formGroup' => '{{label}}<div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">{{input}}</div>', 'hiddenblock' => '<div style="display:none;">{{content}}</div>', 'input' => '<input type="{{type}}" name="{{name}}"{{attrs}}>', 'inputsubmit' => '<input type="{{type}}"{{attrs}}>', 'inputContainer' => '<div class="input row {{type}}{{required}}">{{content}}</div>', 'inputContainerError' => '<div class="input row {{type}}{{required}} error">{{content}}{{error}}</div>', 'label' => '<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2"><label{{attrs}}>{{text}}</label></div>', 'nestingLabel' => '<label{{attrs}}>{{input}}{{text}}</label>', 'legend' => '<legend>{{text}}</legend>', 'option' => '<option value="{{value}}"{{attrs}}>{{text}}</option>', 'optgroup' => '<optgroup label="{{label}}"{{attrs}}>{{content}}</optgroup>', 'select' => '<select name="{{name}}"{{attrs}}>{{content}}</select>', 'selectMultiple' => '<select name="{{name}}[]" multiple="multiple"{{attrs}}>{{content}}</select>', 'radio' => '<input type="radio" name="{{name}}" value="{{value}}"{{attrs}}>', 'radioWrapper' => '{{label}}', 'textarea' => '<textarea name="{{name}}"{{attrs}}>{{value}}</textarea>', 'submitContainer' => '<div class="submit">{{content}}</div>', 'customFile' => $view->element('Painel.Form/customFile'), 'picture' => $view->element('Painel.Form/picture')];
开发者ID:andrecavallari,项目名称:painel,代码行数:5,代码来源:form.php


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