开发者

symfony 1.4: two questions about sfDoctrineApplyPlugin (well, could be also considered as general questions)

I have found in sfDoctrineApplyPlugin a template called applyAfter.php 开发者_开发百科that shows a message like "You have registered ok..." after the users apply for an account. It is called from the sfApply/apply action this way: "return 'After';" when the apply form is valid.

What kind of template is that? I never saw that way (return 'After';) of calling a template. Can someone give me info about that?

Second question: I show a layout with a language select when the the apply form is printed. I wouldn't like to show that language select in the page that shows the message "You have registered ok...". As the action is the same in the both pages (sfApply/apply), what should i do to hide the language select in the verification page?

Javi


The function returns the string 'After' to the caller. The caller always seems to be as follows: $this->widgetSchema->setNameFormat('sfApplyResetRequest[%s]');

So, the string 'After' is being used in conjunction with the setNameFormat function (which is part of the symfony libraries). All it is doing, is setting the 'name' attribute for the form. More information on this function here.

For your second question, you could simply add an IF statement, to check to see if the current route is the one that you do not want to display the language select on. If it isn't, then display the language select.

You can verify the current route with the following code:

sfContext::getInstance()->getRouting()->getCurrentRouteName(); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜