In Symfony (PHP), what is the path of the setTemplate method?

I use the following code in the action class of the XYZ module:

$ this-> setTemplate ("abc.php");

In which directory is he trying to find abc.php?

+3
source share
3 answers

See http://www.symfony-project.org/gentle-introduction/1_4/en/06-Inside-the-Controller-Layer#chapter_06_sub_action_termination . This documentation page contains a complete list of possible template names.

To be clear. Call

$this->setTemplate("abc");

causes Symfony to display the template module/templates/abcSuccess.phpif the returned action method returns sfView::SUCCESSor nothing.

module/templates/abcError.phpwill be displayed if your action returns sfView::ERROR.

, return 'SomeString';, module/templates/abcSomeString.php .

+5

- templates, actions, actions.class.php.

/path/to/my/module/actions/actions.class.php, :

$this->setTemplate("index");

:

/path/to/my/module/templates/indexSuccess.php

, , ; .

:

$this->setTemplate($foo), . executeHomepage(sfWebRequest $request),   homepageSuccess.php ( , setTemplate).

+6

According to the API Documentation :

anytime I write this:

$ this-> setTemplate ('action_name', 'module_name');

0
source

All Articles