You can always provide a base class other than AppModel that contains
the extra methods you need for text processing.
class TextModel extends AppModel {
function textProcessing(){...}
}
class Article extends TextModel
{
function save(...){
$this->textProcessing(...);
...
}
}
or create other classes as needed, cakePHP still handles regular old
PHP without any problems
class TextProcessor {
function textProcessing(...){...}
}
-- model/article.php
require "textProcessor.php";
class Article extends AppModel {
function save(...){
$textProcessor = new TextProcessor();
$textProcessor->textProcessing();
}
}
-reggieB
On Jul 10, 10:30 am, CrazyDave <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've been wanting to include some extra functionality in a model but
> wanted to know the best CakePHP way of going about things.
>
> For example we've got controllers and components, then views and
> helpers.
>
> I want my model to "behave" as normal but say use something like a
> helper to process the text before saving / validation. I did think
> about processing certain content in the model with Geshi but could see
> no easy way of doing so with adding it in all the models required or
> the appmodel.
>
> Should behaviours be used for this sort of thing? As it doesn't quite
> seem right to me at the moment.
>
> Thanks for any help,
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---