2009年7月10日星期五

[fw-mvc] Static view helpers

I have a class with a few methods that performs extraction and formatting of
a given piece of xml. This is to be used in a View.
Since this class is stateless, I thought it would be a good idea to make it
a static class. However, this doesn't fit the current architecture of ZF. I
would like to hear your thoughts on this problem.

1) Should I access a static view helper directly?

static class NameSpace_View_Helper_Format {…}

in the View:
echo NameSpace_View_Helper_Format::formatX($xml);

2) or should I access a unprefixed static class directly:

static class NameSpace_Format {…}

in the View:
echo NameSpace_Format::formatX($xml);

3) …?
--
View this message in context: http://www.nabble.com/Static-view-helpers-tp24428415p24428415.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: