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


PHP GridField::__construct方法代码示例

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


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

示例1: __construct

 public function __construct($name, $title = null, SS_List $dataList = null, PublishableGridFieldConfig $config = null)
 {
     $config = $config ?: PublishableGridFieldConfig_Base::create();
     parent::__construct($name, $title, $dataList, $config);
     Requirements::css('publishable/css/PublishableGridField.css');
     Requirements::javascript('publishable/javascript/PublishableGridField.js');
 }
开发者ID:helpfulrobot,项目名称:studiobonito-silverstripe-publishable,代码行数:7,代码来源:PublishableGridField.php

示例2: __construct

 public function __construct($name, $title, $parent)
 {
     $this->record = $parent->{$name}();
     $this->parent = $parent;
     $config = GridFieldConfig::create()->addComponent(new GridFieldDetailForm())->addComponent(new GridFieldHasOneEditButton());
     $list = new HasOneButtonRelationList($this->record, $name, $parent);
     parent::__construct($name, $title, $list, $config);
 }
开发者ID:burnbright,项目名称:silverstripe-hasonefield,代码行数:8,代码来源:HasOneButtonField.php

示例3: __construct

 public function __construct($name, $title = null, SS_List $dataList = null)
 {
     parent::__construct($name, $title, $dataList);
     $config = new GridFieldConfig_RecordEditor();
     $config->removeComponentsByType('GridFieldDeleteAction');
     $config->removeComponentsByType('GridFieldDetailForm');
     $config->addComponent(new PageHolderGridFieldDetailForm());
     $config->addComponent(new GridFieldPageHistoryButton(), 'GridFieldPageCount');
     $this->setConfig($config);
 }
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-pageholder,代码行数:10,代码来源:PageHolderGridField.php

示例4: GridFieldToolbarHeader

 /**
  * Create GridField for FeedBlocks
  */
 function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null)
 {
     if (!$config) {
         $config = GridFieldConfig::create()->addComponents(new GridFieldToolbarHeader(), new GridFieldAddNewButton('toolbar-header-right'), new GridFieldSortableHeader(), new GridFieldDataColumns(), new GridFieldPaginator(20), new FeedBlock_GridFieldRefreshButton(), new GridFieldEditButton(), new GridFieldDeleteAction(), new FeedBlock_GridFieldDetailForm());
         if (count($dataList) > 1 && class_exists('GridFieldSortableRows')) {
             $config->addComponent(new GridFieldSortableRows('SortOrder'));
         }
     }
     parent::__construct($name, $title, $dataList, $config);
 }
开发者ID:richardsjoqvist,项目名称:silverstripe-blocks,代码行数:13,代码来源:FeedBlock_Manager.php

示例5: __construct

 /**
  * Creates a new GridField field
  * @param {string} $name Name of the GridField
  * @param {string} $title Title of the GridField
  * @param {SS_List} $dataList Data List to use in the GridField
  * @param {GridFieldConfig} $config GridField Configuration to use
  */
 public function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null)
 {
     $this->name = $name;
     $state = new StatefulGridFieldState($this);
     //Replace the state with a StatefulGridField_State instance
     $this->state = $state;
     parent::__construct($name, $title, $dataList, $config);
     //Replace the state with a StatefulGridField_State instance
     $this->state = $state;
     $this->getConfig()->removeComponentsByType('GridState_Component')->addComponent(new StatefulGridFieldState_Component());
 }
开发者ID:helpfulrobot,项目名称:webbuilders-group-silverstripe-statefulunsavedlist,代码行数:18,代码来源:StatefulGridField.php

示例6: __construct

 /**
  * Usage [e.g. in getCMSFields]
  *    $field = new PickerField('Authors', 'Selected Authors', $this->Authors(), 'Select Author(s)');
  *     
  * @param string $name              - Name of field (typically the relationship method)
  * @param string $title             - GridField Title
  * @param SS_List $dataList         - Result of the relationship component method (E.g. $this->Authors())
  * @param string $linkExistingTitle - AddExisting Button Title
  * @param string $sortField         - Field to sort on. Be sure it exists in the $many_many_extraFields static
  */
 public function __construct($name, $title = null, SS_List $dataList = null, $linkExistingTitle = null, $sortField = null)
 {
     $config = GridfieldConfig::create()->addComponents(new GridFieldButtonRow('before'), new GridFieldToolbarHeader(), new GridFieldDataColumns(), new GridFieldTitleHeader(), new GridFieldPaginator(), new PickerFieldAddExistingSearchButton(), new PickerFieldDeleteAction());
     if ($sortField) {
         $config->addComponent(new GridFieldOrderableRows($sortField));
     }
     if (!$linkExistingTitle) {
         $linkExistingTitle = $this->isHaveOne() ? 'Select a ' . $dataList->dataClass() : 'Select ' . $dataList->dataClass() . '(s)';
         // plural [has_many, many_many]
     }
     $config->getComponentByType('PickerFieldAddExistingSearchButton')->setTitle($linkExistingTitle);
     return parent::__construct($name, $title, $dataList, $config);
 }
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-pickerfield,代码行数:23,代码来源:PickerField.php

示例7: __construct

 public function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null)
 {
     parent::__construct($name, $title, $dataList, $config);
     $this->addExtraClass('ss-tiled-gridfield');
 }
开发者ID:helpfulrobot,项目名称:axllent-silverstripe-tiled-gridfield,代码行数:5,代码来源:TiledGridField.php

示例8: __construct

 /**
  * @param string $name
  * @param null $title
  * @param SS_List|null $dataList
  * @param GridFieldConfig|null $config
  */
 public function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null)
 {
     parent::__construct($name, $title, $dataList, $config);
     $this->getConfig()->addComponent(new GridFieldButtonRow('after'));
     $this->getConfig()->addComponent(new ResetGridStateButton('buttons-after-right'));
 }
开发者ID:helpfulrobot,项目名称:littlegiant-silverstripe-persistentgridfield,代码行数:12,代码来源:PersistentGridField.php


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