Better way to do the action/template naming stuff
By default symfony always looks for a template file to load called
actionNameSuccess.php. However you can override this. At any time in your
action you can specify a command: $this->setTemplate('newTemplateName');
which will then load the template called newTemplateNameSuccess.php
On Wed, Oct 27, 2010 at 8:55 AM, Gábor Fási <[email protected]> wrote:
> Do you mean you wish to change the 'index' and 'show' part, or the
> 'Success' part?
> The first one comes from the action's name, as long as you rename the
> function in the actions.class.php file, you can rename the file.
> The second part comes from your action's return value, Success is the
> default, but you can use anything there. If you return 'Foobar' in
> your executeBaz function, symfony will look for a template called
> bazFoobar.php. There are some build-in constants like sfView::SUCCESS.
>
> See
> http://www.symfony-project.org/gentle-introduction/1_4/en/06-Inside-the-Controller-Layer#chapter_06_sub_action_termination
>
> On Wed, Oct 27, 2010 at 00:47, xpanshun <[email protected]> wrote:
> > Let me re-iterate I have never worked with Symfony or any other such
> > framework before this; I am using it for a school project.
> >
> >
> > Two questions...
> >
> > 1)
> >
> > Can the default file names (i.e. indexSuccess.php, showSuccess.php,
> > etc.) be changed as long as the action names are changed in the
> > actions.class.php in that module or does the chain run deeper than
> > that?
> >
> >
> > Also,
> >
> > 2)
> >
> > I want to use the default form provided to me on the frontend after
> > running the following command:
> > $ php symfony doctrine:generate-module --with-show --non-
> > verbose-templates frontend customer Customer.
> >
> > The form generated for users to input information (shown
> > in ...customer/new - newSuccess.php) labels the fields according to my
> > database schema.
> >
> > So, the form shown in the browser has field names like: "customer
> > fname" instead of something you would normally use when creating a
> > form manually like: "First Name:".
> >
> > Is there a way I can change this, or am I not supposed to use this
> > form in such a way?
> >
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
> >
> > 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]<symfony-users%[email protected]>
> > For more options, visit this group at
> > http://groups.google.com/group/symfony-users?hl=en
> >
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> 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]<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
--
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
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