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


PHP ArrayList::renderWith方法代码示例

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


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

示例1: Field

 /**
  * Get HTML for the field to display
  *
  * @param array $properties Properties array
  * @return string
  */
 public function Field($properties = array())
 {
     $module_dir = basename(dirname(dirname(__DIR__)));
     Requirements::javascript($module_dir . '/javascript/MovieTitleField.js');
     Requirements::add_i18n_javascript($module_dir . '/javascript/lang');
     $list = new ArrayList($this->composite_fields);
     return $list->renderWith('MovieTitleField');
 }
开发者ID:hughdavenport,项目名称:silverstripe-movieinformation,代码行数:14,代码来源:MovieTitleField.php

示例2: getHTMLFragments

 public function getHTMLFragments($grid)
 {
     $cols = new ArrayList();
     foreach ($grid->getColumns() as $name) {
         $meta = $grid->getColumnMetadata($name);
         $cols->push(new ArrayData(array('Name' => $name, 'Title' => $meta['title'])));
     }
     return array('header' => $cols->renderWith('GridFieldTitleHeader'));
 }
开发者ID:helpfulrobot,项目名称:ajshort-silverstripe-gridfieldextensions,代码行数:9,代码来源:GridFieldTitleHeader.php

示例3: getHTMLFragments

 /**
  * @param GridField $grid
  * @return array
  */
 public function getHTMLFragments($grid)
 {
     $cols = new ArrayList();
     foreach ($grid->getColumns() as $name) {
         $meta = $grid->getColumnMetadata($name);
         $cols->push(new ArrayData(array('Name' => $name, 'Title' => $meta['title'])));
     }
     $days = new ArrayList();
     for ($i = 0; $i < 5; $i++) {
         $date = new Date();
         $date->setValue(date('d-m-Y', strtotime('+' . $i . ' days', strtotime($this->startDate))));
         $isHoliday = in_array($date->Format('Y-m-d'), $this->holidays);
         $days->push(new ArrayData(array('Day' => $date->Format('l'), 'IsHoliday' => $isHoliday)));
     }
     return array('header' => $cols->renderWith('RosterGridFieldTitleHeader', array('StartDate' => $this->startDate, 'Days' => $days)));
 }
开发者ID:helpfulrobot,项目名称:danae-miller-clendon-silverstripe-roster,代码行数:20,代码来源:RosterGridFieldTitleHeader.php

示例4: processTemplateHTML

 function processTemplateHTML($templateName, $templateVariables = null)
 {
     if (!$templateVariables) {
         $templateVariables = new ArrayList();
     }
     $mappingService = Config::inst()->get('Mappable', 'mapping_service');
     $result = $templateVariables->renderWith($templateName . $mappingService . 'HTML');
     return $result;
 }
开发者ID:helpfulrobot,项目名称:weboftalent-mappable,代码行数:9,代码来源:MapAPI.php

示例5: getRowTemplate

 private function getRowTemplate(GridField $grid, GridFieldEditableColumns $editable)
 {
     $columns = new ArrayList();
     $handled = array_keys($editable->getDisplayFields($grid));
     if ($grid->getList()) {
         $record = Object::create($grid->getModelClass());
     } else {
         $record = null;
     }
     $fields = $editable->getFields($grid, $record);
     foreach ($grid->getColumns() as $column) {
         if (in_array($column, $handled)) {
             $field = $fields->dataFieldByName($column);
             $field->setName(sprintf('%s[%s][{%%=o.num%%}][%s]', $grid->getName(), __CLASS__, $field->getName()));
             $content = $field->Field();
         } else {
             $content = null;
         }
         $attrs = '';
         foreach ($grid->getColumnAttributes($record, $column) as $attr => $val) {
             $attrs .= sprintf(' %s="%s"', $attr, Convert::raw2att($val));
         }
         $columns->push(new ArrayData(array('Content' => $content, 'Attributes' => $attrs, 'IsActions' => $column == 'Actions')));
     }
     return $columns->renderWith('GridFieldAddNewInlineRow');
 }
开发者ID:helpfulrobot,项目名称:ajshort-silverstripe-gridfieldextensions,代码行数:26,代码来源:GridFieldAddNewInlineButton.php


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