當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。