[Catalyst] question from tutorial - does creating HTML in a
controller using HTML::Widget violate MVC?
Nilson Santos Figueiredo Junior
acid06 at gmail.com
Wed Dec 6 01:34:32 GMT 2006
On 12/5/06, Perrin Harkins <perrin at elem.com> wrote:
> It can be really easy to add custom view code to TT templates. You can
> immediately load any class and just call it:
>
> [% USE MyView %]
> [% MyView.method(arg) %]
Yes, but you'd need to manually use the correct class in every
template and then call the appropriate method. This can be automated
for the general case.
> Or you can pass a sub ref to the stash with your data and just call it:
>
> [% sub_ref(arg) %]
Yes, but this sub ref would need to be created somewhere else, which
would probably end up being at the controller, which is wrong.
> There's no need to do anything special for TT or make a "plugin" unless
> you want to do something that requires access to the TT internals.
By plugin, I meant anything that is called Template::Plugin::* and can
be USEd inside a template (since [% USE Module %] will map to
Template::Plugin::Module).
-Nilson Santos F. Jr.
More information about the Catalyst
mailing list