/** * Open the edit row using a \Dewdrop\Db\Field object to determine the * label text and the value of the "for" attribute on the label tag. * * @param Field $field * @return string */ protected function openField(Field $field) { return $this->openArray(array('label' => $field->getLabel(), 'labelFor' => $field->getHtmlId(), 'hideLabel' => $field->isType('boolean'))); }
/** * Use the supplied \Dewdrop\Db\Field object to set the helper's options * and then render the input. * * @param Field $field * @param array $options * @return string */ protected function directField(Field $field, array $options = array()) { $fieldDefaults = array('name' => $field->getControlName(), 'id' => $field->getHtmlId(), 'value' => $field->getValue()); return $this->directArray($fieldDefaults + $options); }
/** * Render the image picker using the supplied Field object. * * @param Field $field * @return string */ public function directField(Field $field) { return $this->directArray(array('name' => $field->getControlName(), 'id' => $field->getHtmlId(), 'value' => $field->getValue())); }
public function direct(Field $field, Field $cascadeFrom) { $this->view->headScript()->appendFile($this->view->bowerUrl('/dewdrop/www/js/cascade-select.js')); return $this->view->select(['name' => $field->getControlName(), 'id' => $field->getHtmlId(), 'options' => [], 'value' => $field->getValue(), 'attributes' => ['data-cascade-options' => $this->view->encodeJsonHtmlSafe($field->getOptionGroups()->fetchJsonWrapper()), 'data-cascade-from' => '#' . $cascadeFrom->getHtmlId(), 'data-cascade-title' => "Choose a {$cascadeFrom->getLabel()}...", 'data-show-blank' => true, 'data-blank-title' => '', 'data-value' => $field->getValue()]]); }
/** * Use a \Dewdrop\Db\Field object to set the editor's id and content. * * @param Field $field * @return string */ public function directField(Field $field) { $field->getFilterChain()->attach(new StripSlashes()); return $this->directArray(array('name' => $field->getControlName(), 'value' => $field->getValue(), 'id' => $field->getHtmlId())); }