mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
30 lines
590 B
PHP
30 lines
590 B
PHP
|
<?php
|
||
|
/**
|
||
|
* Created by PhpStorm.
|
||
|
* User: tony
|
||
|
* Date: 8/26/18
|
||
|
* Time: 12:55 PM
|
||
|
*/
|
||
|
|
||
|
namespace A2nt\CMSNiceties\Extensions;
|
||
|
|
||
|
|
||
|
use SilverStripe\Core\Extension;
|
||
|
use SilverStripe\Forms\CompositeField;
|
||
|
use SilverStripe\Forms\FieldList;
|
||
|
|
||
|
class AddressExtension extends Extension
|
||
|
{
|
||
|
public function updateFormFields(FieldList $fields)
|
||
|
{
|
||
|
$holder = CompositeField::create();
|
||
|
foreach ($fields as $field) {
|
||
|
$holder->push($field);
|
||
|
$fields->remove($field);
|
||
|
}
|
||
|
|
||
|
$holder->addExtraClass('col-sm-6');
|
||
|
$fields->push($holder);
|
||
|
}
|
||
|
}
|