How to set default values (input field) in symfony 1.4 generated forms

I was trying to set default values for an input field.

public function executeNew(sfWebRequest $request)
{
$this->customer = Doctrine::getTable(‘Customer’)->find(array($request->getParameter(‘customer’)));
$this->forward404Unless($this->customer);
$this->form = new CallLogForm();
$this->form->setDefault(‘customer_id’,$request->getParameter(‘customer’));
}

This is the way to set hidden values of default values for an input field

$this->form->setDefault(‘customer_id’,$request->getParameter(‘customer’));

About

me : yeay its me arun

Tagged with: , , ,
Posted in framework, Symfony

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>