addElement('text', 'string', array( 'label' => 'Search string', 'required' => true, )); $form->addElement('text', 'replacement', array( 'label' => 'Replacement', 'required' => true, )); return $form; } public function transform($value) { return str_replace($this->settings['string'], $this->settings['replacement'], $value); } }