[Solar-talk] controller helpers, maybe?

Paul M Jones pmjones at ciaweb.net
Mon Jul 9 10:41:21 CDT 2007


On Jul 9, 2007, at 9:04 AM, Rodrigo Moraes wrote:

> Hi,
> I'm adding more and more helper methods to my base application
> classes, and started to think in something like view helpers, but for
> controllers.
>
> I've tested the idea following very closely Solar_View helper
> implementation, and it worked so fine. :) It's all in
> Tipos_Controller_Page / Tipos_Controller_Helper:
>
>    http://dev.tipos.org/browser/trunk/Tipos/Controller/Page.php
>    http://dev.tipos.org/browser/trunk/Tipos/Controller/Helper.php
>
> Do you think this would be too much? Or maybe have other ideas to add
> extra shared functionalities to controllers?

You know, this is a really good idea.  We might want to call them  
"plugins" instead of "helpers", if only to keep the vocabulary  
distinct.  I can think of a couple situations I'm in right now where  
this would help immensely.

I would think these should be protected-access, not public-access, so  
that a "Plugin_Foo" would be called with ->_foo(), not ->foo().

Other thoughts?



--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the Solar-talk mailing list