public function getFormFields() { $fieldList = new FieldList(); $fieldList->push(new NumericField('Amount', 'Amount', '')); $fieldList->push(new DropDownField('Currency', 'Select currency :', $this->gateway->getSupportedCurrencies())); return $fieldList; }
function __construct($controller, $name, $title = "Training") { if ($member = Member::currentUser()) { } else { $member = new Member(); } $fields = new FieldList(new HeaderField($title)); $extraFields = $member->getTrainingFields(); foreach ($extraFields as $field) { if ("Password" == $field->title() && $member->ID) { } elseif ("Password" == $field->title()) { $fields->push(new ConfirmedPasswordField("Password")); } else { $fields->push($field); } } $actions = new FieldList(new FormAction("doSave", "Sign Up Now")); $requiredFields = new RequiredFields("FirstName", "Surname", "Email", "Password"); if ($controller->Options) { $array = array(); $explodedOptions = explode(",", $controller->Options); foreach ($explodedOptions as $option) { $option = trim(Convert::raw2att($option)); $array[$option] = $option; } if (count($array)) { $fields->push(new DropdownField("SelectedOption", "Select Option", $array)); } } $fields->push(new TextField("BookingCode", "Booking Code (if any)")); parent::__construct($controller, $name, $fields, $actions, $requiredFields); $this->loadNonBlankDataFrom($member); return $this; }
public function getCMSFields() { $fields = new FieldList(); $fields->push(TextField::create("TwitterHandle", "Twitter Handle")); $fields->push(NumericField::create("NumberOfTweets", "Number of Tweets")); return $fields; }
public function parameterFields() { $fields = new FieldList(); // Check if any order exist if (Order::get()->exists()) { $first_order = Order::get()->sort('Created ASC')->first(); $months = array('All'); $statuses = Order::config()->statuses; array_unshift($statuses, 'All'); for ($i = 1; $i <= 12; $i++) { $months[] = date("F", mktime(0, 0, 0, $i + 1, 0, 0)); } // Get the first order, then count down from current year to that $firstyear = new SS_Datetime('FirstDate'); $firstyear->setValue($first_order->Created); $years = array(); for ($i = date('Y'); $i >= $firstyear->Year(); $i--) { $years[$i] = $i; } //Result Limit $result_limit_options = array(0 => 'All', 50 => 50, 100 => 100, 200 => 200, 500 => 500); $fields->push(DropdownField::create('Filter_Month', 'Filter by month', $months)); $fields->push(DropdownField::create('Filter_Year', 'Filter by year', $years)); $fields->push(DropdownField::create('Filter_Status', 'Filter By Status', $statuses)); $fields->push(DropdownField::create("ResultsLimit", "Limit results to", $result_limit_options)); } return $fields; }
/** * @param FieldList $fields */ public function updateCMSFields(FieldList $fields) { $tabName = Config::inst()->get('Downloadable', 'tab_name'); $tabFields = array(); $upload = new UploadField('DownloadableFiles', ''); $upload->setFolderName(Config::inst()->get('Downloadable', 'source_folder')); $tabFields[] = $upload; // For certain types of products, it makes sense to include downloads // from parent (ProductVariation) or child products (GroupedProduct) // NOTE: there could be better ways to do this that don't involve checking // for specific classes. The advantage here is that the fields show up // even if the product has not yet been saved or doesn't yet have a // parent or child products. $p = $this->owner instanceof ProductVariation ? $this->owner->Product() : $this->owner->Parent(); if ($p && $p->exists() && $p->hasExtension('Downloadable')) { $tabFields[] = new CheckboxField('IncludeParentDownloads', 'Include downloads from parent product in purchase'); } elseif (class_exists('GroupedProduct') && $this->owner instanceof GroupedProduct) { $tabFields[] = new CheckboxField('IncludeChildDownloads', 'Include downloads from child products in purchase'); } // this will just add unnecessary queries slowing down the page load //$tabFields[] = new LiteralField('DownloadCount', '<p>Total Downloads: <strong>' . $this->owner->getDownloads()->count() . '</strong></p>'); // Product variations don't have tabs, so we need to be able // to handle either case. if ($fields->first() instanceof TabSet) { $fields->addFieldsToTab("Root.{$tabName}", $tabFields); } else { $fields->push(new HeaderField('DownloadsHeader', $tabName)); foreach ($tabFields as $f) { $fields->push($f); } } }
/** * Constructor * * @param Controller $controller The parent controller, necessary to * create the appropriate form action tag. * @param string $name The method on the controller that will return this * form object. * @param FieldList|FormField $fields All of the fields in the form - a * {@link FieldList} of {@link FormField} * objects. * @param FieldList|FormAction $actions All of the action buttons in the * form - a {@link FieldList} of */ function __construct($controller, $name, $fields = null, $actions = null) { if (isset($_REQUEST['BackURL'])) { $backURL = $_REQUEST['BackURL']; } else { $backURL = Session::get('BackURL'); } if (!$fields) { $fields = new FieldList(); // Security/changepassword?h=XXX redirects to Security/changepassword // without GET parameter to avoid potential HTTP referer leakage. // In this case, a user is not logged in, and no 'old password' should be necessary. if (Member::currentUser()) { $fields->push(new PasswordField("OldPassword", _t('Member.YOUROLDPASSWORD', "Your old password"))); } $fields->push(new PasswordField("NewPassword1", _t('Member.NEWPASSWORD', "New Password"))); $fields->push(new PasswordField("NewPassword2", _t('Member.CONFIRMNEWPASSWORD', "Confirm New Password"))); } if (!$actions) { $actions = new FieldList(new FormAction("doChangePassword", _t('Member.BUTTONCHANGEPASSWORD', "Change Password"))); } if (isset($backURL)) { $fields->push(new HiddenField('BackURL', 'BackURL', $backURL)); } parent::__construct($controller, $name, $fields, $actions); }
public function getCustomFields() { $fields = new FieldList(); $fields->push(new TextField('SmallWidth', 'Small Width')); $fields->push(new TextField('MediumWidth', 'Medium Width')); return $fields; }
public function __construct($controller, $name, Order $order) { $this->order = $order; $fields = new FieldList(HiddenField::create('OrderID', '', $order->ID)); $actions = new FieldList(); //payment if (self::config()->allow_paying && $order->canPay()) { $gateways = GatewayInfo::get_supported_gateways(); //remove manual gateways foreach ($gateways as $gateway => $gatewayname) { if (GatewayInfo::is_manual($gateway)) { unset($gateways[$gateway]); } } if (!empty($gateways)) { $fields->push(HeaderField::create("MakePaymentHeader", _t("OrderActionsForm.MAKEPAYMENT", "Make Payment"))); $outstandingfield = Currency::create(); $outstandingfield->setValue($order->TotalOutstanding()); $fields->push(LiteralField::create("Outstanding", sprintf(_t("OrderActionsForm.OUTSTANDING", "Outstanding: %s"), $outstandingfield->Nice()))); $fields->push(OptionsetField::create('PaymentMethod', 'Payment Method', $gateways, key($gateways))); $actions->push(FormAction::create('dopayment', _t('OrderActionsForm.PAYORDER', 'Pay outstanding balance'))); } } //cancelling if (self::config()->allow_cancelling && $order->canCancel()) { $actions->push(FormAction::create('docancel', _t('OrderActionsForm.CANCELORDER', 'Cancel this order'))); } parent::__construct($controller, $name, $fields, $actions); $this->extend("updateForm"); }
public function getCMSFields() { $fields = new FieldList(); $fields->push(new LiteralField("Course Prerequisite", "<h2>Course Prerequisite</h2>")); $fields->push(new TextField("Name", "Name")); return $fields; }
public function getCMSFields() { $fields = new FieldList([TextField::create('Title')]); if ($this->exists()) { $folderName = 'Documents'; $config = $this->Page()->exists() ? $this->Page()->config()->get('page_documents') : null; if (is_array($config)) { if (isset($config['folder'])) { $folderName = $config['folder']; } if (isset($config['section']) && $config['section']) { $filter = new URLSegmentFilter(); $section = implode('-', array_map(function ($string) { return ucfirst($string); }, explode('-', $filter->filter($this->Title)))); $folderName .= '/' . $section; } } $fields->push(SortableUploadField::create('Documents', 'Documents')->setDescription('Drag documents by thumbnail to sort')->setFolderName($folderName)); } else { $fields->push(LiteralField::create('DocumentsNotSaved', '<p>Save category to add documents</p>')); } $this->extend('updateCMSFields', $fields); return $fields; }
public function __construct($name, $title = null, $value = '', $extension = null, $areaCode = null, $countryCode = null) { $this->areaCode = $areaCode; $this->ext = $extension; $this->countryCode = $countryCode; // Build fields $fields = new FieldList(); if ($this->countryCode !== null) { $countryField = NumericField::create($name . '[Country]', false, $countryCode, 4)->addExtraClass('phonenumber-field__country'); $fields->push($countryField); } if ($this->areaCode !== null) { $areaField = NumericField::create($name . '[Area]', false, $areaCode, 4)->addExtraClass('phonenumber-field__area'); $fields->push($areaField); } $numberField = NumericField::create($name . '[Number]', false, null, 10)->addExtraClass('phonenumber-field__number'); $fields->push($numberField); if ($this->ext !== null) { $extensionField = NumericField::create($name . '[Extension]', false, $extension, 6)->addExtraClass('phonenumber-field__extension'); $fields->push($extensionField); } parent::__construct($title, $fields); $this->setName($name); if (isset($value)) { $this->setValue($value); } }
public function updateSettingsFields(FieldList $fields) { $changeFreq = Singleton('Page')->dbObject('ChangeFreq')->enumValues(); $fields->push(DropDownField::create('ChangeFreq', 'Change Frequency', $changeFreq)); $priority = Singleton('Page')->dbObject('Priority')->enumValues(); $fields->push(DropDownField::create('Priority', 'Priority', $priority)); }
/** * Returns the edit form for this admin. * * @param type $id * @param type $fields * * @return Form */ public function getEditForm($id = null, $fields = null) { $fields = new FieldList(); $desc = _t('SilvercartProductImageAdmin.Description'); $descriptionField = new SilvercartAlertInfoField('SilvercartProductImagesDescription', str_replace(PHP_EOL, '<br/>', $desc)); $uploadField = new UploadField('SilvercartProductImages', _t('SilvercartProductImageAdmin.UploadProductImages', 'Upload product images')); $uploadField->setFolderName(SilvercartProductImageImporter::get_relative_upload_folder()); $fields->push($uploadField); $fields->push($descriptionField); if (!SilvercartProductImageImporter::is_installed()) { $cronTitle = _t('SilvercartProductImageAdmin.CronNotInstalledTitle') . ':'; $cron = _t('SilvercartProductImageAdmin.CronNotInstalledDescription'); $cronjobInfoField = new SilvercartAlertDangerField('SilvercartProductImagesCronjobInfo', str_replace(PHP_EOL, '<br/>', $cron), $cronTitle); $fields->insertAfter('SilvercartProductImages', $cronjobInfoField); } elseif (SilvercartProductImageImporter::is_running()) { $cronTitle = _t('SilvercartProductImageAdmin.CronIsRunningTitle') . ':'; $cron = _t('SilvercartProductImageAdmin.CronIsRunningDescription'); $cronjobInfoField = new SilvercartAlertSuccessField('SilvercartProductImagesCronjobInfo', str_replace(PHP_EOL, '<br/>', $cron), $cronTitle); $fields->insertAfter('SilvercartProductImages', $cronjobInfoField); } $uploadedFiles = $this->getUploadedFiles(); if (count($uploadedFiles) > 0) { $uploadedFilesInfo = '<br/>' . implode('<br/>', $uploadedFiles); $fileInfoField = new SilvercartAlertWarningField('SilvercartProductImagesFileInfo', $uploadedFilesInfo, _t('SilvercartProductImageAdmin.FileInfoTitle')); $fields->insertAfter('SilvercartProductImages', $fileInfoField); } $actions = new FieldList(); $form = new Form($this, "EditForm", $fields, $actions); $form->addExtraClass('cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses()); $form->loadDataFrom($this->request->getVars()); $this->extend('updateEditForm', $form); return $form; }
function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField('Value')); $fields->push(new TextField('RawValue')); return $fields; }
/** * Get CMS fields * * @return FieldList */ function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField('Title', _t('Block.TITLE', 'Title'))); $imageField = new UploadField('Image', _t('Block.IMAGE', 'Image')); $imageField->getValidator()->setAllowedExtensions(array('jpg', 'gif', 'png')); $fields->push($imageField); $fields->push(new TextField('FeedURL', _t('FeedBlock.FEEDURL', 'FeedURL'))); $fields->push(new NumericField('Results', _t('FeedBlock.RESULTS', 'Results'))); $fields->push(new NumericField('SummaryMaxLength', _t('FeedBlock.SUMMARYMAXLENGTH', 'SummaryMaxLength'))); $fields->push(new NumericField('CacheTime', _t('FeedBlock.CACHETIME', 'CacheTime'))); $fields->push(new CheckboxField('Striptags', _t('FeedBlock.STRIPTAGS', 'Striptags'))); // Add modifier field (select function to run feed item through before displaying it) if ($this->modifier_functions) { if (isset($this->modifier_functions)) { $options = array('' => 'None'); foreach ($this->modifier_functions as $f) { $options[$f] = $f; } $fields->push(new DropdownField('Modifier', _t('FeedBlock.MODIFIER', 'Feed item filter'), $options)); } } $fields->push(new TextField('LinkExternal', _t('FeedBlock.LINKEXTERNAL', 'External link URL'))); if (class_exists('OptionalTreeDropdownField')) { $treeField = new OptionalTreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree'); $treeField->setEmptyString('No page'); } else { $treeField = new TreeDropdownField('LinkInternalID', _t('Block.LINKINTERNAL', 'Internal link'), 'SiteTree'); } $fields->push($treeField); return $fields; }
public function getCMSFields() { $fields = new FieldList(); $fields->push(new LiteralField("Title", "<h2>Training Course Level</h2>")); $fields->push(new TextField("Level", "Level")); return $fields; }
/** * Add subsites-specific fields to the folder editor. */ public function updateCMSFields(FieldList $fields) { $ctrl = null; if (Controller::has_curr()) { $ctrl = Controller::curr(); } if (!$ctrl) { return; } // This fixes fields showing up for no reason in the list view (not moved to Details tab) if ($ctrl->getAction() !== 'EditForm') { return; } if ($this->owner instanceof Folder) { // Allow to move folders from one site to another $sites = Subsite::accessible_sites('CMS_ACCESS_AssetAdmin'); $values = array(); $values[0] = _t('FileSubsites.AllSitesDropdownOpt', 'All sites'); foreach ($sites as $site) { $values[$site->ID] = $site->Title; } ksort($values); if ($sites) { //Dropdown needed to move folders between subsites $dropdown = new DropdownField('SubsiteID', _t('FileSubsites.SubsiteFieldLabel', 'Subsite'), $values); $dropdown->addExtraClass('subsites-move-dropdown'); $fields->push($dropdown); } // On main site, allow showing this folder in subsite if ($this->owner->SubsiteID == 0 && !Subsite::currentSubsiteID()) { $fields->push(new CheckboxField('ShowInSubsites', _t('SubsiteFileExtension.ShowInSubsites', 'Show in subsites'))); } } }
/** * Gets the form fields as defined through the metadata * on {@link $obj} and the custom parameters passed to FormScaffolder. * Depending on those parameters, the fields can be used in ajax-context, * contain {@link TabSet}s etc. * * @return FieldList */ public function getFieldList() { $fields = new FieldList(); // tabbed or untabbed if ($this->tabbed) { $fields->push(new TabSet("Root", $mainTab = new Tab("Main"))); $mainTab->setTitle(_t('SiteTree.TABMAIN', "Main")); } //var_dump($this->obj->db());exit(); // add database fields foreach ($this->obj->db() as $fieldName => $fieldType) { if ($this->restrictFields && !in_array($fieldName, $this->restrictFields)) { continue; } // @todo Pass localized title if ($this->fieldClasses && isset($this->fieldClasses[$fieldName])) { $fieldClass = $this->fieldClasses[$fieldName]; $fieldObject = new $fieldClass($fieldName); } else { $fieldObject = $this->obj->dbObject($fieldName)->scaffoldFormField(null, $this->getParamsArray()); } $fieldObject->setTitle($this->obj->fieldLabel($fieldName)); if ($this->tabbed) { $fields->addFieldToTab("Root.Main", $fieldObject); } else { $fields->push($fieldObject); } } return $fields; }
function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField("Hyperlink", "Hyperlink (e.g. http://www.silverstripe.co.nz)")); $fields->push(new HeaderField("MakeSureToUploadImageFirst", "Please make sure image is uploaded first in file and images section", 5)); $fields->push(new DropdownField("LogoID", "Image / Picture / Logo", array(0 => "--- please select ---") + Image::get()->map()->toArray())); return $fields; }
function getCMSFields() { $fields = new FieldList(); $chart = new GooglePerformanceChart(); $fields->push(new LiteralField('ReportTitle', "<h3>{" . _t('GoogleReport.REPORTTITLE', "Google Analytics") . "}</h3>")); $fields->push(new LiteralField('ReportDescription', $chart->renderWith('GooglePerformanceChart'))); return $fields; }
/** * @return FieldList */ public function parameterFields() { $filtersList = new FieldList(); $filtersList->push(DateField::create("ReviewDateAfter", "Review date after or on")->setConfig("showcalendar", true)); $filtersList->push(DateField::create("ReviewDateBefore", "Review date before or on", date("d/m/Y", strtotime("midnight")))->setConfig("showcalendar", true)); $filtersList->push(new CheckboxField("ShowVirtualPages", "Show Virtual Pages")); return $filtersList; }
function parameterFields() { $params = new FieldList(); $params->push(new DateField("DateFrom", "Report From", date("Y-01-01"))); $params->push(new DateField("DateTo", "Report To", date("Y-12-31"))); $params->push(new DropdownField("PrivateBookings", "Private Bookings", array('Both' => 'Show Private and Public', 'Private' => 'Show Private Bookings Only', 'Public' => 'Show Public Bookings Only'))); return $params; }
public function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField('Name', 'Name of the project')); $fields->push(new TextField('Codename', 'CodeName')); $fields->push(new TextareaField('Description', 'Short description')); return $fields; }
/** * Builds an item edit form. The arguments to getCMSFields() are the popupController and * popupFormName, however this is an experimental API and may change. * * @todo In the future, we will probably need to come up with a tigher object representing a partially * complete controller with gaps for extra functionality. This, for example, would be a better way * of letting Security/login put its log-in form inside a UI specified elsewhere. * * @return Form */ function ItemEditForm() { if (empty($this->record)) { $controller = Controller::curr(); $noActionURL = $controller->removeAction($_REQUEST['url']); $controller->getResponse()->removeHeader('Location'); //clear the existing redirect return $controller->redirect($noActionURL, 302); } $actions = new FieldList(); if ($this->record->ID !== 0) { $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Save', 'Save'))->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'accept')); $actions->push(FormAction::create('doDelete', _t('GridFieldDetailForm.Delete', 'Delete'))->addExtraClass('ss-ui-action-destructive')); } else { // adding new record //Change the Save label to 'Create' $actions->push(FormAction::create('doSave', _t('GridFieldDetailForm.Create', 'Create'))->setUseButtonTag(true)->addExtraClass('ss-ui-action-constructive')->setAttribute('data-icon', 'add')); // Add a Cancel link which is a button-like link and link back to one level up. $curmbs = $this->Breadcrumbs(); if ($curmbs && $curmbs->count() >= 2) { $one_level_up = $curmbs->offsetGet($curmbs->count() - 2); $cancelText = _t('GridFieldDetailForm.CancelBtn', 'Cancel'); $text = "\r\n\t\t\t\t<a class=\"crumb ss-ui-button ss-ui-action-destructive cms-panel-link ui-corner-all\" href=\"" . $one_level_up->Link . "\">\r\n\t\t\t\t\t{$cancelText}\r\n\t\t\t\t</a>"; $actions->push(new LiteralField('cancelbutton', $text)); } } $fk = $this->gridField->getList()->foreignKey; $this->record->{$fk} = $this->gridField->getList()->foreignID; $form = new Form($this, 'ItemEditForm', $this->record->getCMSFields(), $actions, $this->component->getValidator()); $form->loadDataFrom($this->record); // TODO Coupling with CMS $toplevelController = $this->getToplevelController(); if ($toplevelController && $toplevelController instanceof LeftAndMain) { // Always show with base template (full width, no other panels), // regardless of overloaded CMS controller templates. // TODO Allow customization, e.g. to display an edit form alongside a search form from the CMS controller $form->setTemplate('LeftAndMain_EditForm'); $form->addExtraClass('cms-content cms-edit-form center ss-tabset'); $form->setAttribute('data-pjax-fragment', 'CurrentForm Content'); if ($form->Fields()->hasTabset()) { $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); } if ($toplevelController->hasMethod('Backlink')) { $form->Backlink = $toplevelController->Backlink(); } elseif ($this->popupController->hasMethod('Breadcrumbs')) { $parents = $this->popupController->Breadcrumbs(false)->items; $form->Backlink = array_pop($parents)->Link; } else { $form->Backlink = $toplevelController->Link(); } } $cb = $this->component->getItemEditFormCallback(); if ($cb) { $cb($form, $this); } return $form; }
/** * @return FieldSet */ public function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField("Name", "Name")); $fields->push(new TextField("Duration", "Duration (in Days)")); $fields->push(new CheckboxField('AutoRenew', 'Auto Renew')); $fields->push(new FileIFrameField("PDF", "PDF")); return $fields; }
/** * @return FieldList */ public function parameterFields() { $filtersList = new FieldList(); $filtersList->push(DateField::create("ReviewDateAfter", _t("PagesDueForReviewReport.REVIEWDATEAFTER", "Review date after or on"))->setConfig("showcalendar", true)); $filtersList->push(DateField::create("ReviewDateBefore", _t("PagesDueForReviewReport.REVIEWDATEBEFORE", "Review date before or on"), date("d/m/Y", strtotime("midnight")))->setConfig("showcalendar", true)); $filtersList->push(new CheckboxField("ShowVirtualPages", _t("PagesDueForReviewReport.SHOWVIRTUALPAGES", "Show Virtual Pages"))); $filtersList->push(new CheckboxField("OnlyMyPages", _t("PagesDueForReviewReport.ONLYMYPAGES", "Only Show pages assigned to me"))); return $filtersList; }
/** * @return FieldList */ public function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField('MenuTitle', 'Menu Title (will default to selected page title)')); $fields->push(new TreeDropdownField('PageID', 'Page', 'Page')); $fields->push(new TextField('Link', 'Link (use when not specifying a page)')); $fields->push(new CheckboxField('IsNewWindow', 'Open in a new window?')); $this->extend('updateCMSFields', $fields); return $fields; }
public function updateCMSFields(FieldList $fields) { $formID = $this->owner->FormID != 0 ? $this->owner->FormID : Session::get('CMSMain.currentPage'); $formFields = EditableFormField::get()->filter('ParentID', (int) $formID); if ($formFields) { $source = $formFields->map('ID', 'Title'); $fields->push(DropdownField::create('ConditionFieldID', 'Only send this email if the following field', $source)->setEmptyString('Select...')); $fields->push(TextField::create('ConditionFieldValue', '...has this value')); } }
/** * @param FieldList $fields * @return FieldList|void */ public function updateCMSFields(FieldList $fields) { $oldFields = $fields->toArray(); foreach ($oldFields as $field) { $fields->remove($field); } $fields->push(new LiteralField("Title", "<h2>Support Channel Type</h2>")); $fields->push(new TextField("Type", "Type")); return $fields; }
function getCMSFields() { $fields = new FieldList(); $attach = new CustomUploadField('Attachment', 'File'); $attach->setFolderName('marketing/event_material'); $attach->setAllowedExtensions(array('doc', 'docx', 'txt', 'rtf', 'xls', 'xlsx', 'pages', 'ppt', 'pptx', 'pps', 'csv', 'html', 'htm', 'xhtml', 'xml', 'pdf', 'ai', 'key')); $fields->push(new TextField('Name')); $fields->push($attach); return $fields; }