Re: Access model/controler data without requestAction

2006-09-14 Thread Sebastian Macias
Thanks for the excellent comments Troy and AD7six. I think I was actually "trying to be too politically correct" and I didn't want to use others models inside my controllers so I was using requestAction to get data from other models but also to avoid having duplicated views as AD7six mentioned;

Re: Access model/controler data without requestAction

2006-09-14 Thread [EMAIL PROTECTED]
A good place I use requestaction is for subtotal of shopping cart. This way I can place the subtotal of the shopping cart on as many views as I want just by calling the requestaction. I could have just as easily made it a method of the model, but then I would have to set variable for use in the v

Re: Access model/controler data without requestAction

2006-09-14 Thread [EMAIL PROTECTED]
> /app/views/elements/blog.thtml > blog stuff > foreach ($data['Comment'] as $comment) { > echo $this->renderElement ("comment",Array("data"=>$comment)); // > probably need to rearrange the comment array a bit, writing from > memory. > } for a more accurate description of this rearrang

Re: Access model/controler data without requestAction

2006-09-14 Thread AD7six
Hi Sebastian, I think that requestAction is often considered/used when a method that should be in a model is located in a controller - if you are only retreiving data from a model, possibly after manipulating it a bit, consider moving the logic that is in your controller to the model and then sim

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
Also you can just do $this->Airport->findAllByCity($this->data["Airtravelcalculator"]["city_input"]) and then return stuff. In a controller method I don't find myself using requestaction much at all. I instead use the Models methods (findBy, findAll, etc.) to get any data I need in a specific vi

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
I develop on my laptop and get 1.3 second renderings. You could also paste your code to CakeBin for people to take a look at and see if there is a way to optimize it. http://cakephp.org/pastes --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
Hi Troy. I set DEBUG 2 and these are my results of 1 sample request: SQL Queries Time: 17 queries took 17 ms Total request processing time: 1.8491s I think 1.8 seconds is a long time considering that the SQL queries only take 17 ms and I'm the only user of my Dev server. I will be looking f

Re: Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
I also need to be able to call other controller methods such as save($data) without the requestAction abuse performance inconveniences. I read the article at: http://www.thinkingphp.org/2006/06/24/welcome-to-the-dark-side-of-plugins-in-cakephp/ I think that is kind of a good approach but not s

Re: Access model/controler data without requestAction

2006-09-13 Thread [EMAIL PROTECTED]
You could consider setting the recursive variable of models and controllers that you don't need them to retrieve their full out associations. The associations can take up most of the time. What is taking up most of your time is not the actual requestaction itself, but all the SQL queries. Turn

Access model/controler data without requestAction

2006-09-13 Thread Sebastian Macias
Hi, I'm sure many people have had the same issue I'm experiencing. I'm working on a project where I need to get data from more than 30 models/controllers from a controller action. I have been using the $this->requestAction('/airports/getAirportList/' . $this->params["data"]["Airtravelcalculator