hi.
your route have mandatory parameter id.
url_for('@firm_show?id='.$firm->getIdFirm())
will fix this prob, but that's dirty solution.here is sense to use routes like link_to($firm->__toString(), 'firm_show', $firm) but for this usage you have to rename your field id_firm to id in the schema or to create method getId() method in the model Firm or reconfigure key for selection for route firm. i'd prefer just to rename field in the schema. On 5 дек, 21:19, dziobacz <[email protected]> wrote: > hm....... unfortunately something is wrong :( > > With @: url_for('@firm_show?id_firm='.$firm->getIdFirm()) > I have error: The "/firm/:id.:sf_format" route has some missing > mandatory parameters (:id). > > Without @: url_for('firm_show?id_firm='.$firm->getIdFirm()) > I have error: The route "firm_show?id_firm=1" does not exist. > > On 5 Gru, 19:33, Gábor Fási <[email protected]> wrote: > > > Either make it "@firm_show?firm_id=" . $firm["id"], or simply drop the @ :) > > > On Sat, Dec 5, 2009 at 18:43, dziobacz <[email protected]> wrote: > > > So now I have: > > > url_for('@firm_show', $firm) > > > > But now I have an error: > > > 500 | Internal Server Error | InvalidArgumentException > > > The "/firm/:id.:sf_format" route has some missing mandatory parameters > > > (:id). > > > > :(( Why ? :(( > > > > On 5 Gru, 16:07, Gábor Fási <[email protected]> wrote: > > >> The problem lies elsewhere: when you generate the show urls in your > > >> index action. According to the error message, you do it by passing > > >> "firm/show" to the url_for, and now it cannot find it like that > > >> anymore. Presuming you call your route collection "firm", try > > >> "@firm_show". > > > >> On Sat, Dec 5, 2009 at 15:35, dziobacz <[email protected]> wrote: > > >> > Ok - now I have error: > > >> > 500 | Internal Server Error | sfConfigurationException > > >> > Unable to find a matching route to generate url for params "array > > >> > ( 'action' => 'show', 'module' => 'firm', 'id_firm' => '1',)". > > > >> > So now action SHOW is a default action ?? Why ?? > > >> > In action SHOW I have: > > >> > public function executeShow(sfWebRequest $request) > > >> > { > > >> > $this->firm = Doctrine::getTable('Firm')->find(array($request- > > >> >>getParameter('id_firm'))); > > >> > $this->forward404Unless($this->firm); > > >> > } > > > >> > But when I have changed on: > > >> > public function executeShow(sfWebRequest $request) > > >> > { > > >> > $this->firm = $this->getRoute()->getObject(); > > >> > } > > > >> > I still have the same error. > > > >> > On 5 Gru, 12:12, Gábor Fási <[email protected]> wrote: > > >> >> Tryhttp://localhost/frontend_dev.php/firmthatshouldbethe index. > > > >> >> On Sat, Dec 5, 2009 at 11:37, dziobacz <[email protected]> > > >> >> wrote: > > >> >> > I would like to start using Object Route Class as in tutorial (I > > >> >> > have > > >> >> > never used it): > > >> >> >http://www.symfony-project.org/jobeet/1_4/Doctrine/en/05 > > > >> >> > I have in schema.yml: > > >> >> > Firm: > > >> >> > columns: > > >> >> > id_firm: > > >> >> > type: integer(1) > > >> >> > primary: true > > >> >> > autoincrement: true > > >> >> > email: > > >> >> > type: string(100) > > >> >> > notnull: true > > >> >> > description: > > >> >> > type: clob > > >> >> > notnull: true > > > >> >> > So I have modified file routing.yml: > > >> >> > firm: > > >> >> > class: sfDoctrineRouteCollection > > >> >> > options: { model: Firm } > > > >> >> > homepage: > > >> >> > url: / > > >> >> > param: { module: firm, action: index } > > > >> >> > And I have generated module 'firm'. But after came on site: > > >> >> >http://localhost/frontend_dev.php/firm/indexIhaveanerror: > > >> >> > 404 | Not Found | sfError404Exception > > >> >> > Empty module and/or action after parsing the URL "/firm/index" (/). > > > >> >> > What is going on ? What have I done wrong ? > > > >> >> > -- > > > >> >> > You received this message because you are subscribed to the Google > > >> >> > Groups "symfony users" group. > > >> >> > To post to this group, send email to [email protected]. > > >> >> > To unsubscribe from this group, send email to > > >> >> > [email protected]. > > >> >> > For more options, visit this group > > >> >> > athttp://groups.google.com/group/symfony-users?hl=en. > > > >> > -- > > > >> > You received this message because you are subscribed to the Google > > >> > Groups "symfony users" group. > > >> > To post to this group, send email to [email protected]. > > >> > To unsubscribe from this group, send email to > > >> > [email protected]. > > >> > For more options, visit this group > > >> > athttp://groups.google.com/group/symfony-users?hl=en. > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > "symfony users" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]. > > > For more options, visit this group > > > athttp://groups.google.com/group/symfony-users?hl=en. -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
