多个action.class.php [英] Multiple action.class.php
问题描述
我确实有一个模块,例如帐户.当然你会在 acount/actions/action.class.php 中找到一个文件.
I do have an module e.g. account. Of course you will find a file called in acount/actions/action.class.php.
PHP 文件 action.class.php 越来越大.可以扩展吗?
The PHP-file action.class.php is getting big. Is it possible to extend it?
举个例子:
/account/action/action.class.php
/account/action/action2.class.php
如果可能的话,action.class.php 和 action2.class.php 中的代码是什么样的?和/或我应该在 config-ymal-file 的什么地方输入内容?
If it is possible, how does the code look like in action.class.php and in action2.class.php? And/or where should I enter something in a config-ymal-file?
提前致谢!
骗子
推荐答案
Symfony 操作可以声明为两种风格:
Symfony actions can be declare in two flavors:
- 一个继承自 sfActions 的大型 actios.class.php 文件
- 继承自 sfAction 的多个 xxxAction.class.php 文件
两者基本相同,但不能混用(您必须决定是要 123123 个文件、每个动作 1 个还是一个大的胖文件).
The are both basically the same but these cant be mixed (you must decide if you want 123123 files, 1 per action, or one big fat file).
这里是关于这个问题的 symfony 参考:Symfony Front Controller - Actions 检查 Action 部分.
Here its the symfony reference on this matters: Symfony Front Controller - Actions check the Action section.
这篇关于多个action.class.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!