本文整理匯總了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');
}
示例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;
}
示例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