cms-niceties/src/Extensions/AddressExtension.php

35 lines
722 B
PHP
Raw Normal View History

2021-06-19 21:30:03 +02:00
<?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;
2022-05-10 13:09:06 +02:00
/**
* Class \A2nt\CMSNiceties\Extensions\AddressExtension
*
* @property \A2nt\CMSNiceties\Extensions\AddressExtension $owner
*/
2021-06-19 21:30:03 +02:00
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);
}
}