i have 2 models namely 'client' , 'pet' have admin generated modules each. there one-to-many relationship involved want able create new pet using cid (client id) specified in url (i.e. /pet/new/cid/6)
i disabled cid field in client form parameter url passed default value.
i tried overriding actions.class.php of admin generated module code:
public function executecreate(sfwebrequest $request) { $this->form = $this->configuration->getform(); $params = $request->getparameter($this->form->getname()); $params["cid"] = $request->getparameter('cid'); $request->setparameter($this->form->getname(), $params); parent::executecreate($request); }
it works if replaced
$request->getparameter('cid');
with hard-coded int value think problem i'm not able parameter url.
i think might missing on routing configurations i'm new framework i'm not sure do.
you can pass parameter cid in url :
/pet/new?cid=6
and result in action :
$request->getparameter('cid');
the first part of routing (/pet/new) specific doctrineroutecollection
Comments
Post a Comment