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(
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.
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(
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
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
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
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
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
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
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' =
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' =
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' =
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(
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
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
, 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
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
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
, 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
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
. 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
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
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
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
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
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
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
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
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
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
30 matches
Mail list logo