Re: Same queries in different controllers

2009-05-07 Thread Nancy
This seems like a good time to say "Doh!". Thanks much. :) On May 6, 6:59 pm, "Dr. Loboto" wrote: > app_model.php > > On May 7, 12:00 am, Nancy wrote: > > > So, this was great but I'm wondering if I can go a bit further with > > this. > > > All these tables have queries that are very similar, s

Re: Same queries in different controllers

2009-05-06 Thread Dr. Loboto
app_model.php On May 7, 12:00 am, Nancy wrote: > So, this was great but I'm wondering if I can go a bit further with > this. > > All these tables have queries that are very similar, so similar that I > could use exactly the same code in most of them, like here's an > example: > [code] > function

Re: Same queries in different controllers

2009-05-06 Thread Nancy
So, this was great but I'm wondering if I can go a bit further with this. All these tables have queries that are very similar, so similar that I could use exactly the same code in most of them, like here's an example: [code] function getByKit($type, $id) { $rows = $this->find($type, array

Re: Same queries in different controllers

2009-05-06 Thread Nancy
Nifty! I'll give this a shot! On May 5, 6:57 pm, brian wrote: > You can create a method in each model and place the find details > there. Then, from the controllers: > > $foo = $this->YourModel->yourMethod(...) > > "Fat models, thin controllers", as the saying goes. > > On Tue, May 5, 2009 at 7

Re: Same queries in different controllers

2009-05-05 Thread brian
You can create a method in each model and place the find details there. Then, from the controllers: $foo = $this->YourModel->yourMethod(...) "Fat models, thin controllers", as the saying goes. On Tue, May 5, 2009 at 7:42 PM, Nancy wrote: > > I have a bunch of tables that are highly inter-relat

Same queries in different controllers

2009-05-05 Thread Nancy
I have a bunch of tables that are highly inter-related and I have them all being displayed, like an initial index view, from one controller. They're getting updated and the index of each table is refreshed via that table's controller (Ajax). The bad part about this is that I have to keep the que