cms-niceties/src/Extensions/AddressExtension.php

30 lines
590 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;
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);
}
}