开发者

Where do I place base action class in Symfony plugin?

I'm creating a plugin for my symfony project, which includes a base action class, i.e.:

<?php
// myActions.class.php
class myActions extends sfActions {
    /* ... */
}

Where in my plugin folder (e.g.: plugins/sfMyPlugin/???) should I place this file?

The goal is to have actions th开发者_开发知识库at are NOT a part of this plugin extend this class, hopefully having the class be autoloaded (similar to if it were placed under apps/my_app/lib). If it can't be autoloaded, how do I get symfony to include my php file?


You typically put it in your plugin's lib directory. The general conventions is also to to name with Base in the name so given your example that would be BasemyActions. Then you would also make an empty concrete class called myActions and you would extend that within your plugin thus allowing other user to complety replace myActions with their own implementation (so long as it extends the base class) or to simply extend myActions.


you can place it in the lib directory of your plugin. This is what the generate:plugin-module task of the sfTaskExtraPlugin does.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜