Re: display data 3 tables

2014-06-05 Thread ajt
There just is no user being displayed with the below, there is with Teacher in the find if I add it but every field is undefined in the view. $this-Tutorsession-recursive = 2; $contain = array('Teacher' = array('User')); $this-set('tutor', $this-Tutorsession-find('first',array(

Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
Isn't $tutor['Teacher']['User']['username'] what you're looking for? On 5 Jun 2014, at 14:18, ajt jagguy...@gmail.com wrote: There just is no user being displayed with the below, there is with Teacher in the find if I add it but every field is undefined in the view.

Re: display data 3 tables

2014-06-05 Thread ajt
yes thats it, I just didnt know how I referenced it and with this code. This took hours to solve so well done $this-Tutorsession-recursive = 2; $this-Tutorsession-Teacher-contain('User'); $this-set('tutor', $this-Tutorsession-find('first', array(

Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
With the Containable behaviour you should set recursive to -1. Recursion makes the model automatically attache related models n deep (where n is your recursion level) so can give unexpected (or at least uncontrolled) results. When it is -1 it only returns the model associations you specify. The

Re: display data 3 tables

2014-06-05 Thread ajt
I set recursive to -1 and it doesnt work as I get user error again. Recursive set to 2 is what works -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP

Re: display data 3 tables

2014-06-05 Thread ajt
Yes this works without recursive $contain = array('Teacher' = array('User'),'Student' = array('User')); $this-set('tutor', $this-Tutorsession-find('first',array( 'conditions' = array('Teacher.user_id' = $id), 'contain' = $contain ))); -- Like Us on FaceBook

Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
You are not doing something right. Can you show more code with the debugged output please? Cracking this and understanding what is happening will help you enormously with developing Cake apps from here. On 5 Jun 2014, at 15:18, ajt jagguy...@gmail.com wrote: I set recursive to -1 and it

display data 3 tables

2014-06-04 Thread ajt
Hi, I just want to display fields from 3 tables which I have checked on how to do this and I am not clear on this. Examples I have found concentrate on 2 fields or keyed in conditions on multiple tables. I have models all related in some way. I want the username from a tutorsession table and

Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
Look at the Containable behaviour: http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html On 4 Jun 2014, at 14:47, ajt jagguy...@gmail.com wrote: Hi, I just want to display fields from 3 tables which I have checked on how to do this and I am not clear on this. Examples I

Re: display data 3 tables

2014-06-04 Thread ajt
This doesnt work as I get an error when displaying the username from the associated table. I guess i am doing something wrong still. $this-set('tutor', $this-Tutorsession-find('all', array('conditions' = array('Teacher.user_id' = $id) ,array('contain' =

Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
A couple of things... Why find all when presumably there is only one expected teacher? The contain statement doesn't go inside an array: $this-set( 'tutor', $this-Tutorsession-find( 'first', array( 'conditions' =

Re: display data 3 tables

2014-06-04 Thread ajt
This still doesnt work as I get an error when I reference the user table which should be linked unless I need to do this another way? view echo 'td'. $item['User']['username'].'/td'; ///error user undefined $this-set( 'tutor', $this-Tutorsession-find( 'first', array( 'conditions' =

Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
You are referencing the $user variable when you have set a $tutor variable. Add this to your view so you can inspect the shape of the $tutor variable and work out how to access the key you are looking for: die(debug($tutor)); It'll probably look something like this: array(

Best Practice to display data in layout or view

2012-08-11 Thread sanjeev
Hello, What is the best practice to display data e.g. list of products, events, news in layout? 1. Element - which requires to call requestAction() and also calls beforeFilter from AppController each time 2. Helper - need to use Model class in helper Regards, -- You received this message

Re: Best Practice to display data in layout or view

2012-08-11 Thread Tilen Majerle
i'm using second option. Model can be created with ClassRegistry::init('ModelName'); to get model instance :) -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/8/11 sanjeev sanjeevdive...@gmail.com Hello, What is the best practice to display data e.g. list of products, events, news

Re: Best Practice to display data in layout or view

2012-08-11 Thread Mark Wratten
, August 11, 2012 2:33:33 AM UTC-4, Sanjeev Divekar wrote: Hello, What is the best practice to display data e.g. list of products, events, news in layout? 1. Element - which requires to call requestAction() and also calls beforeFilter from AppController each time 2. Helper - need to use

Display data from specific data in the Home Page

2010-12-26 Thread Ahmed - CakePHP
to know: How can I display data from the Tables in the database in the Home Page. For example: - I want to display the latest posts. also, may be, the latest registered users or whatever Can you please tell me how CakePHP deals with this. Thank you in Advance, Ahmed Check out the new CakePHP

Re: Display data from specific data in the Home Page

2010-12-26 Thread Amit Badkas
want to know: How can I display data from the Tables in the database in the Home Page. For example: - I want to display the latest posts. also, may be, the latest registered users or whatever Can you please tell me how CakePHP deals with this. Thank you in Advance, Ahmed Check out

Re: Display data from specific data in the Home Page

2010-12-26 Thread Stefano Salvatori
, posts, comments and categories). Also I designed the Home Page, which is empty now. I want to know: How can I display data from the Tables in the database in the Home Page. For example: - I want to display the latest posts. also, may be, the latest registered users or whatever Can you

Re: Ways to display data from another controller without resorting to requestAction?

2008-11-18 Thread David C. Zentgraf
there are ways to display data from another controller instead of using requestAction? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php

AW: Ways to display data from another controller without resorting to requestAction?

2008-11-18 Thread Liebermann, Anja Carolin
. November 2008 09:18 An: cake-php@googlegroups.com Betreff: Re: Ways to display data from another controller without resorting to requestAction? http://book.cakephp.org/view/63/Introduction On 18 Nov 2008, at 16:55, Pizgin wrote: David tell me please more detail. Thanks. On 18 нояб, 10:31, David C

Ways to display data from another controller without resorting to requestAction?

2008-11-17 Thread Pizgin
Hi! What else there are ways to display data from another controller instead of using requestAction? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake

Re: Ways to display data from another controller without resorting to requestAction?

2008-11-17 Thread David C. Zentgraf
How about making a reusable component? On 18 Nov 2008, at 16:22, Pizgin wrote: Hi! What else there are ways to display data from another controller instead of using requestAction? Thanks. --~--~-~--~~~---~--~~ You received this message because you

Re: Ways to display data from another controller without resorting to requestAction?

2008-11-17 Thread Pizgin
David tell me please more detail. Thanks. On 18 нояб, 10:31, David C. Zentgraf [EMAIL PROTECTED] wrote: How about making a reusable component? On 18 Nov 2008, at 16:22, Pizgin wrote: Hi! What else there are ways to display data from another controller instead of using requestAction

Re: Display data from two related tables on one page

2007-09-18 Thread fr3nch13
http://manual.cakephp.org --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL

Display data from two related tables on one page

2007-09-18 Thread Indian Baker
Hi, This may be a very simple one, but I'm stumped. What I need to do is Say I have the same blog example.. what I want is when I'm viewing a user's page like localhost/blog/users/view/3/ I see the user details, like name, username password etc etc. What I want is below that I should also get

Re: Display data from two related tables on one page

2007-09-18 Thread Dr. Tarique Sani
On 9/18/07, Indian Baker [EMAIL PROTECTED] wrote: when I'm viewing a user's page like localhost/blog/users/view/3/ I see the user details, like name, username password etc etc. What I want is below that I should also get to see a list of all his postings You need to set up an association

display data

2007-08-14 Thread Wimg
i have problem with display data, for example , i have a database like this a b c 1 2 3 1 3 4 i wanna display result of select a, c where b = 2 in a table. how would my controller and view looks like ? i am a new at cakephp thx a lot

Re: display data

2007-08-14 Thread starkey
I suggest you follow the excellent Blog tutorial in the manual. It will help you out a lot (it did for me!). Shawn On Aug 14, 5:40 am, Wimg [EMAIL PROTECTED] wrote: i have problem with display data, for example , i have a database like this a b c 1 2 3 1 3 4 i wanna display

Re: display data

2007-08-14 Thread Wimg
thx man,, On Aug 14, 9:37 pm, starkey [EMAIL PROTECTED] wrote: I suggest you follow the excellent Blog tutorial in the manual. It will help you out a lot (it did for me!). Shawn On Aug 14, 5:40 am, Wimg [EMAIL PROTECTED] wrote: i have problem with display data, for example , i have