更改 Zend_Tool 生成的模板代码
这是一件愚蠢的小事,但我只是想知道是否有办法改变 Zend_Tool 生成的代码的风格?具体来说,支架样式?
// from this:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
// to this
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
显然这不是一个大问题,但我想可能有一些配置可以解决它?
This is a silly little thing, but I was just wondering whether there was a way to change the style of the code produced by the Zend_Tool? Specifically, the bracket style?
// from this:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
// to this
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
Obviously it's not a huge problem, but I thought there might be some configuration for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
Zend_CodeGenerator_Php_Class::generate
的源代码,第 466 行和后面的(对于 ZF 1.9.2),您会看到类似这样的内容:所以,我愿意不认为这是可配置的。
可能有一种方法,通过继承重载一些东西,但我不知道你如何考虑你的新类......
仍然:您想要的格式不遵守 Zend Framework 的编码标准,其中指出, 4.4.1。类声明:
我猜对于编写该代码的人来说,使其尊重框架本身的编码标准似乎是合乎逻辑的 ^^
(并且,当您使用该框架开发应用程序时,我建议您使用这个标准也是如此)
Taking a look at the source of
Zend_CodeGenerator_Php_Class::generate
, line 466 and following (for ZF 1.9.2), you'll see something like this :So, I do not think this is configurable.
There might be a way, overloading some stuff via inheritance, but I don't know how you'd have your new class taken into account...
Still : the formating you want does not respect Zend Framework's Coding Standard, which states, in 4.4.1. Class Declaration :
I'm guessing it seemed logical for the guys who coded that to make it respect the coding standard of the framework itself ^^
(And, as you are developping an application using that framework, I would recommend that you'd use that standard too)