3.0 - setting data from models to the view

2014-02-26 Thread Thomas von Hassel
In 2.x when you have an array from a model query, you just set that to the view, and work from there. What is best practice in 3.x ? Just set the array of model objects directly to the view or ... ? /thomas -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter

Re: Dynamic menu content in layout

2014-02-26 Thread Sam Clauw
Okay, let's suppose I want to put my menu in an element called top_menu.ctp. I want to get my data out of the database, so probably, I shouldn't connect with my database in that .ctp file. I wonder if that's the right way to do so? MVC normally split us the model logic and the view logic, but

Re: Dynamic menu content in layout

2014-02-26 Thread Thomas von Hassel
No, you don't want to anything in the view that involves querying the database. The controller action for that given page should know what menu to fetch from database and set that to the view. /thomas On 26 Feb 2014, at 20:39, Sam Clauw i...@bellewaerdefun.be wrote: Okay, let's suppose I

Re: Dynamic menu content in layout

2014-02-26 Thread euromark
Take a look at the ideas here: https://github.com/MenschDankeGmbH/cake-menu_builder Maybe that helps. Am Samstag, 22. Februar 2014 11:46:16 UTC+1 schrieb Sam Clauw: What I'm trying to do is to put two dynamic navigation menus in my CakePHP layout (default.ctp). The main menu should have

How to configure file router with array url

2014-02-26 Thread Nguyễn Cường
I have one form with content as follows ?php echo $this-Form-create('Post',array('url'='/Posts/result')); ... echo $this-Form-end(__('Submit')); ? I to run the application on localhost. I want path after updated takes the form : localhost/project/bai-viet/ket-qua What can I do ? Thank you to all

Question about cakephp forms and JS

2014-02-26 Thread Thomas Goeminne
Hi, I am trying to make a form which collects data on submit. Maybe someone can help me. I have a canvas id=canvas Then I have a form: ?php echo $this-Form-create('Drawing'); echo $this-Form-input('id'); echo $this-Form-input('name'); echo $this-Form-input('description'); echo