You can get an instance of your Setting model by using the
ClassRegistry:

$Setting =& ClassRegistry::init('Setting');
$Setting->getMinMax();

Or did I misunderstand you?

-David

On 19 Okt., 17:15, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Thanks Pablo.
>
> Helps when you instantiate huh?
>
> But still is there a more CakePHp way to do this then calling models
> from within models.  Seems like there should be a cleaner way.
>
> EW
>
> On Oct 18, 7:36 pm, Pablo Viojo <[EMAIL PROTECTED]> wrote:
>
> > Sent from my iPhone
>
> > On 18-10-2008, at 17:07, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > I am having some trouble with the proper way to go about modeling
> > > this. I would love suggestions.
>
> > > I have a simple database with an id, key and value fields.   I made an
> > > administrative model, controller and views to add and manage the table
> > > of options.
>
> > > I have some functions in the model that return values based on the
> > > criteria, and I can call this from any controller easily.
> > > $minMax= $this->Setting->getBotcheckMinMax();
>
> > > I need a clean way to let models access the data within this table.
> > > And I don't want to use relationships because the records really
> > > relate specifically to any model, but may be used by any.
>
> > > I tried importing via;
> > > App::import('Model'.'Setting')
>
> > $Setting = new Setting();
> > $Setting->getMinMax()
>
> > > Setting::getMinMax()
>
> > > But it died trying to connect to the table once the settings method
> > > was called.
>
> > > It would be nice to build a component that could be access by the
> > > model.  I just don't want to bulk up every controller that wants to
> > > use some settings. It would be nicer to keep that in the models.
>
> > > Regards,
> > > Eddie
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to