[Catalyst] To plugin or not to plugin; style/best-practices

David K Storrs dstorrs at dstorrs.com
Wed Dec 14 19:03:36 CET 2005


On Dec 13, 2005, at 7:40 PM, apv wrote:

> On Tuesday, December 13, 2005, at 04:34  PM, Matt S Trout wrote:
>> On Tue, Dec 13, 2005 at 04:10:52PM -0800, apv wrote:
>>> I'm working on a user supplied comment. I want to apply some auto
>>> formatting to it (paras but with somewhat complicated rules for  
>>> where
>>> they go, no simple splitting on "\n\n," so it's not going to be very
>>> compact code) in addition to HTML sanitizing.
>>>
>>> Should this be a plugin or a controller? If a plugin makes sense, is
>>> there one already out there I should look at for good learning code?
>>
>> Sounds like view logic to me :)
> I rather agree in part but it's information that is going into the  
> DB as opposed
> to--directly, anyway--the screen.

In that case, shouldn't it be in the model?  Have the Controller send  
raw text with \n\n and let the Model class sort out what to write to  
the DB.

--Dks



More information about the Catalyst mailing list