Cake presentation @ NYPHP

2006-09-11 Thread nate

I'll be giving a presentation on Cake at NYPHP on September 26th.  You
can check out http://nyphp.org for the full details.  And if I haven't
shamelessly self-promoted my blog enough, you can also read about it at
http://cake.insertdesignhere.com/posts/view/9


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread Mark Somerville

NickCarlson wrote:
 If I do the following in my controller:

 $this-set('myVar', 2006);

 How would I access the value of myVar from within my controller?

 For example, for debugging purposes, I just want to write the following
 code within my controller,
 
 echo $myVar;

It is very annoying that you can't do this.

Mark


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread nate

Okay fine ;-)

It's on my to-do list for Cake 1.2.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread Larry E. Masters aka PhpNut
On 9/11/06, nate [EMAIL PROTECTED] wrote:
Okay fine ;-)It's on my to-do list for Cake 1.2.This is not on any todo list, this will not be added. If you need to debug a var that is set for the view, do it in the view where the code should be tested anyway since it is view output, or debug() like Felix mentioned.
-- /*** @author Larry E. Masters* @var string $userName* @param string $realName* @returns string aka PhpNut* @accesspublic*/ 

--~--~-~--~~~---~--~~
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 PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Simple question about $this-set

2006-09-11 Thread nate

Eeeh, it's too early in the morning...

Yeah, my mistake, Nut is correct on this one.  You can access any view
vars you set as $this-_viewVars[$varName]


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Recursive Relationships in Cake (one model has many sub models) breaks findAll()

2006-09-11 Thread [EMAIL PROTECTED]

AD7six, thank you very much for your answer and quick response. Problem
solved.

Have a great day! : )


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread Bert Van den Brande

But why provide an 'awkward' alternative to retrieve a template var
you set on a controller , but not a simple get('xxx') function ? I
must admit I also searched for this function instinctively a few times
...

You're probably gonna smack me with a very logical reason now ey ;)

On 9/11/06, nate [EMAIL PROTECTED] wrote:

 Eeeh, it's too early in the morning...

 Yeah, my mistake, Nut is correct on this one.  You can access any view
 vars you set as $this-_viewVars[$varName]


 


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread nate

Controller::_viewVars is treated as a protected object property.
Accessing proctected properties within a class or child of the class is
perfectly legal, and I'm not a big fan of adding extra pointless
getters and setters.  The only reason there's a set( ) method for it is
because it provides actual value over and above simply assigning
key/value pairs to an associative array.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Ajax help

2006-09-11 Thread Aaron Santiago

I'd like to know something about ajax and cake, with the $ajax helper 
and the tutorial in grahambird's site, i can update just one DIV... but 
I need to update more than one, does someone know how?
Note: forgive my english, I'm Colombian

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Cake presentation @ NYPHP

2006-09-11 Thread [EMAIL PROTECTED]

Nate, I'm a relatively new user of Cake and a big fan.  I'm looking to
hearing you speak this month at the NYPHP meeting.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: ARO

2006-09-11 Thread iciclebox

If I'm not wrong, ACL uses Modified Pre-Order Tree Traversal (taken
from http://wiki.cakephp.org/docs:acl:introduction)


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Simple question about $this-set

2006-09-11 Thread Bert Van den Brande

Ok tnx for the explanation :)

Reason I searched for that function was that I had split some
controller logic into a couple of reusable methods, and at a certain
point I needed to now the decision of method X inside method Y.

Of course there were plenty other solutions, but looking for a way to
retrieve the var I had set in method X was my first intention ...

On 9/11/06, nate [EMAIL PROTECTED] wrote:

 Controller::_viewVars is treated as a protected object property.
 Accessing proctected properties within a class or child of the class is
 perfectly legal, and I'm not a big fan of adding extra pointless
 getters and setters.  The only reason there's a set( ) method for it is
 because it provides actual value over and above simply assigning
 key/value pairs to an associative array.


 


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Ajax help

2006-09-11 Thread Chris Hartjes

On 9/11/06, Aaron Santiago [EMAIL PROTECTED] wrote:

 I'd like to know something about ajax and cake, with the $ajax helper
 and the tutorial in grahambird's site, i can update just one DIV... but
 I need to update more than one, does someone know how?
 Note: forgive my english, I'm Colombian

Hi Aaron,

I'm not sure how you would do it with the ajax helpers, but you might
actually have to write the Javascript code yourself rather than use
the helpers.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Re: Ajax help

2006-09-11 Thread Samuel DeVore

It is possible, I think that nate has talked about it in the list
before, try searching the list at googlegroups  if you can't find it
I'll try to find the reference later today

Sam D

On 9/11/06, Chris Hartjes [EMAIL PROTECTED] wrote:

 On 9/11/06, Aaron Santiago [EMAIL PROTECTED] wrote:
 
  I'd like to know something about ajax and cake, with the $ajax helper
  and the tutorial in grahambird's site, i can update just one DIV... but
  I need to update more than one, does someone know how?
  Note: forgive my english, I'm Colombian

 Hi Aaron,

 I'm not sure how you would do it with the ajax helpers, but you might
 actually have to write the Javascript code yourself rather than use
 the helpers.

 --
 Chris Hartjes

 The greatest inefficiencies come from solving problems you will never have.
 -- Rasmus Lerdorf

 @TheBallpark - http://www.littlehart.net/attheballpark
 @TheKeyboard - http://www.littlehart.net/atthekeyboard

 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Problem:data retrieved from database are cached

2006-09-11 Thread zipman

I have a model and I save some data through a form in the according
table.
The problem is that when I go to the link that regards the function
that retrieves
the data from the database and just presents them, the new data are not
shown,
even though they exist in the database. Only when i refresh the page
through
the browser the new data are shown.

Is there any way to prevent this from happening,because it really is a
big problem?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread Chris Hartjes

On 9/11/06, zipman [EMAIL PROTECTED] wrote:

 I have a model and I save some data through a form in the according
 table.
 The problem is that when I go to the link that regards the function
 that retrieves
 the data from the database and just presents them, the new data are not
 shown,
 even though they exist in the database. Only when i refresh the page
 through
 the browser the new data are shown.

 Is there any way to prevent this from happening,because it really is a
 big problem?


Cranky Developer to the rescue!

Make sure that you've set debug to 1 in app/config/core.php, and then
delete the model cache files in /app/tmp/cache/models

When debug is set to 0, it acts like it's in production.  When you're
building something, you always want to set debug to 1 or higher to
make sure nothing gets cached.

Hope that helps.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Import Existing Sessions into CAKE

2006-09-11 Thread Cheeze

Bumps for you. I would be very interested to know how to do this as
well.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Model association issue

2006-09-11 Thread Brian French

bump

Brian French wrote:
 I am having trouble associating the multiple models i have with each other.

 I have a 'User' that hasOne 'Fan','Artist','Venue','Promoter'.
 The 'User' also hasAndBelongsToMany of the same ones (like he can 
 subscribe to them as well as be one/all of them).

 I am using the scaffolding to view the associations with them. The 
 associations are being added ok but when i view the user, the 
 associations aren't being picked up. Here are the 'User' model and the 
 'Artist' model (the fan, artist, venue and promoter models all look the 
 same).

 What am i doing wrong?

 (i can supply a url of the scaffolding with the debug set to 2 if you 
 would like)


 ?php
 class Artist extends AppModel
 {
 var $name = 'Artist';
 var $belongsTo = 'User';
 var $hasAndBelongsToMany = 'User';
 }
 ?

 ?php
 class User extends AppModel
 {
 var $name = 'User';

 var $hasOne = array('Fan' =
 array('className'= 'Fan',
   'conditions'   = '',
   'order'= '',
   'dependent'=  true,
   'foreignKey'   = 'user_id'
 ),
 'Artist' =
 array('className'= 'Artist',
   'conditions'   = '',
   'order'= '',
   'dependent'=  true,
   'foreignKey'   = 'user_id'
 ),
 'Venue' =
 array('className'= 'Venue',
   'conditions'   = '',
   'order'= '',
   'dependent'=  true,
   'foreignKey'   = 'user_id'
 ),
 'Promoter' =
 array('className'= 'Promoter',
   'conditions'   = '',
   'order'= '',
   'dependent'=  true,
   'foreignKey'   = 'user_id'
 ),
   );
 var $hasAndBelongsToMany = array('Fan','Artist','Venue','Promoter');
 }
 ?





 

   

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Import Existing Sessions into CAKE

2006-09-11 Thread Chris Hartjes

On 9/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hi,

 I have a PHPBB forum and CAKE application. phpBB is installed within a
 folder inside cake. cake and phpbb have database sessions.

 I am trying to unify login process so that users logging in from phpbb
 dont need to login again when coming to the cakeapp. Also, if the user
 logged in cake-app and then visits phpbb, the login should be
 maintained.

 But when I sign in phpbb and then goto cake app, I get a totally
 different session id. I tried setting the $_SESSION variable in phpbb
 (following another post in this group itself). However its not
 accessible in cake.

Hi there.  I understand what you're trying to do, but sessions are not
the way to do this.  What you really need is a caching system like
memcached.  Sessions can't be shared across different applications
*unless* you create your own custom session handler.  Personally, I've
used memcached for the type of thing you're talking about it and it
worked out really well.

Check out www.dango.com/memcached for more info.  There is an
extension you can compile for memcached, and I believe there are a few
memcached clients written in PHP.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Model association issue

2006-09-11 Thread Chris Hartjes

On 9/8/06, Brian French [EMAIL PROTECTED] wrote:

 I am having trouble associating the multiple models i have with each other.

 I have a 'User' that hasOne 'Fan','Artist','Venue','Promoter'.
 The 'User' also hasAndBelongsToMany of the same ones (like he can
 subscribe to them as well as be one/all of them).

 I am using the scaffolding to view the associations with them. The
 associations are being added ok but when i view the user, the
 associations aren't being picked up. Here are the 'User' model and the
 'Artist' model (the fan, artist, venue and promoter models all look the
 same).

 What am i doing wrong?


I've never used the scaffolding before, but can you show the code that
you think is pulling out the User information?  Also, the database
output (showing all the queries) would be helpfull.  I wonder if the
scaffolding is setting the recursive stuff to -1 and simply showing
User records only...

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Ajax help

2006-09-11 Thread nate

Yes, you can update mutliple divs in a single request.

Check out the following threads for some details on how to do it:

http://groups.google.com/group/cake-php/browse_thread/thread/64187c8a41e8750f/cf10b929a33db24e?#cf10b929a33db24e

http://groups.google.com/group/cake-php/browse_thread/thread/2e373a465753e2ab/14598032d2f2aed4


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: multiple controllers on 1 page

2006-09-11 Thread Brian French




It would mainly be for the view. in the controller i would call the
requestAction and assign the output to a view variable using set():

$this-set('someBlock',$this-requestAction('Controllers/_Method',array('foo'='bar')));
// i think this is right. correct me if im wrong

or (refering to the other thread "Simple question about $this-set")
you can do it like this:

$someBlock =
$this-requestAction('Controllers/_Method',array('foo'='bar'));
echo $someBlock; // refering to other thread in groups
$this-set('someBlock',$someBlock);

anyone, correct me if im wrong.

Brian French

[EMAIL PROTECTED] wrote:

  
bwaters wrote:
  
  
It seems that the consensus is to put the blocks into elements and if
they have data use a requestAction inside the element that returns a
data array containing whatever information you need.  There are lots of
other ways to skin this cat, depending on your situation and how many
blocks you are talking about.

Using requestAction(controller/action, array('return' = 'true'); is
easier but the overhead of multiple views being rendered will kill you
if you have several blocks per page.

I am currently changing my whole project over to the elements /
requestAction combo instead of the RequestAction / view (return =
true) way of doing things.

  
  
Hello Brian.

Where are you putting all the elements together? e.g:
domain/pages/home.thtml or in view? I am also currently doing a small
project where I need to access different controlelrs on each page - so
this post is very interresting to me. 

Best regards.
Asbjrn Morell.





  


--~--~-~--~~~---~--~~
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 PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Re: Re: Ajax help

2006-09-11 Thread Samuel DeVore

see Nate is THE MAN and cake is the BOMB

On 9/11/06, nate [EMAIL PROTECTED] wrote:

 Yes, you can update mutliple divs in a single request.

 Check out the following threads for some details on how to do it:

 http://groups.google.com/group/cake-php/browse_thread/thread/64187c8a41e8750f/cf10b929a33db24e?#cf10b929a33db24e

 http://groups.google.com/group/cake-php/browse_thread/thread/2e373a465753e2ab/14598032d2f2aed4



 



-- 
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Ajax help

2006-09-11 Thread Chris Hartjes

On 9/11/06, nate [EMAIL PROTECTED] wrote:

 Yes, you can update mutliple divs in a single request.

 Check out the following threads for some details on how to do it:

 http://groups.google.com/group/cake-php/browse_thread/thread/64187c8a41e8750f/cf10b929a33db24e?#cf10b929a33db24e

 http://groups.google.com/group/cake-php/browse_thread/thread/2e373a465753e2ab/14598032d2f2aed4


Nate, thanks for pointing that out.  Like I said, I wasn't sure if you
could do it but it's nice to know you don't have to code it by hand if
you don't want to.  Personally, I've started using the YUI for my AJAX
needs and are doing my javascript by hand.

-- 
Chris Hartjes

The greatest inefficiencies come from solving problems you will never have.
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread zipman

Thanks for the reply.
But what if I am in production level? (for me it doesn't work even when
debug=1).
Should i change the permissions for the folder models so that it is not
writeable?(That works)
Isn't there any property in any file, that doesn't allow cache for
models?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Ajax help

2006-09-11 Thread nate


Samuel DeVore wrote:
 see Nate is THE MAN and cake is the BOMB


Thanks, just be sure not to shout that on an airplane.  I'm sure I
would quickly find myself hauled away in handcuffs.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread AD7six

Hi zipman,

are you sending cache headers with your files? If you get a different
result when you access a link from when you press F5 (or equivalent)
surely that indicates that your browser is taking the page results from
it's cache.

So: what exactly are you doing ;), how can this be reproduced etc.

Cheers,

AD7six


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Model association issue

2006-09-11 Thread Brian French




Scaffolding can display this for you, it's a great tool!

You can view the output here: http://www.myclubbersguide.com/users
It contains the queries being used as well as the print_r() of the
object(s).
The code for the models was in the first email/post in this thread. As
far as i understand it, scaffolding is recursive.

Thank you for your help,
Brian French

Chris Hartjes wrote:

  On 9/8/06, Brian French [EMAIL PROTECTED] wrote:
  
  
I am having trouble associating the multiple models i have with each other.

I have a 'User' that hasOne 'Fan','Artist','Venue','Promoter'.
The 'User' also hasAndBelongsToMany of the same ones (like he can
subscribe to them as well as be one/all of them).

I am using the scaffolding to view the associations with them. The
associations are being added ok but when i view the user, the
associations aren't being picked up. Here are the 'User' model and the
'Artist' model (the fan, artist, venue and promoter models all look the
same).

What am i doing wrong?


  
  
I've never used the scaffolding before, but can you show the code that
you think is pulling out the User information?  Also, the database
output (showing all the queries) would be helpfull.  I wonder if the
scaffolding is setting the recursive stuff to -1 and simply showing
User records only...

  


--~--~-~--~~~---~--~~
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 PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---





Save function executes before it should

2006-09-11 Thread zipman

I have CustomersController and i have in it
var $uses = array('Customer','CreditPackage');

so that it uses CreditPackage Model too.

I have the following function

function giveCredits($customer_id,$credit_package_id)
{

$credits=$this-CreditPackage-find(id=.$credit_package_id,array('credits'));
$credits=$credits['CreditPackage']['credits'];


$customer=$this-Customer-find(id=.$customer_id,array('credits','firm'));

$firm=$customer['Customer']['firm'];
$credits_left=$customer['Customer']['credits'];
$new_credits=$credits_left+$credits;

echo Package_credits: .$credits.br;
echo Old_credits: .$credits_left.br;
echo New_credits: .$new_credits.br;




$data=array('Customer'=array('id'=$customer_id,credits=$new_credits));
$this-Customer-save($data);
//some rendering calls follow
}

credit_package_id regards The CreditPackage Model and i give to the
customer i want
the credits the according package has. The problem is the following
If the customer eg. has 0 credits and i give him a package with 1
credit I should get
printed.

Package_credits: 1
Old_credits: 0
New_credits: 1

But i get

Package_credits: 1
Old_credits: 1
New_credits: 2.

It seems as if the Customer-save function is first executed then the
Customer-find,and then
save again.
I have the same problem in other cases when for example i want to see
that the name i try to
insert in a table doesn't already exist. I put some code in the
beforesave function and i always
get the error that it already exists, because it first inserts it in
the table and then checks to see
if it exists.


Can anyone please help me?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Model association issue

2006-09-11 Thread AD7six

Hi Brian,

I took a peek at your link: I don´t quite understand what the problem
is, can you elaborate?

The sql at the foot of the page shows that sql queries are being
executed for your associations. If you look at the user test you can
see that there are results for each association type.

Where is this coming from: array ( [User] = Array ( [id] = 2 [name]
= Fan User [login] = f etc.

if you have created a method named view in your users controller, there
will be no scaffolding for that action.

cheers,

AD7six
PS. the method pr() gives you shorter debugging code and easier to read
output.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread nate

Hi zipman, there's an undocumented feature that allows you to
completely disable Cake's caching by adding this:

define(DISABLE_CACHE, true);

to app/config/core.php.  However, this is only recommended in the most
extreme unusual cases, as your application will take quite a
performance hit for having to query the database for table descriptions
on every request.

However, it doesn't sound like table caching is your issue.  It sounds
more like an HTTP or browser cache thing.  Cake 1.2 has a new
controller method called disableCache() which will send the appropriate
headers so that the browser does not cache your page.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread zipman

Yes,that's the case. I get different results when i access a link
than when i press F5.
When i set /app/tmp/cache/models folder not to be writeable i have no
problem.
But even my browser( firefox) is the problem(I'm using a plugin through
which I disable cache) how can i surpass this ,so that no cacheis used
as regards models?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



*MPG-CAP* new product for saving of Gasoline and Diesel fuel from USA

2006-09-11 Thread Mr. Chan

This is a new business from USA, Many drivers used MPG-CAP to save more
than 20% of gasoline and Diesel fuel in USA and Canada, you can see the
websites here:

http://biz.yahoo.com/prnews/060614/dcw024.html?.v=62

http://www.todaystmj4.com/VideoPlayer/video.aspx?fs=081706_10pm_GasPillSavings

This is the company's website for introduction of this product:

http://www.fat.myffi.biz/en/section_100.asp

Over 1000 people involved in this business within 1 month in Taiwan in
the first quarter of 2006, it will be successful in other Asia regions.

GREAT BUSINESS CHANCE will happen once ten years!!!

If any inquiries, pls e-mail to [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



download problem

2006-09-11 Thread Aleck


Hi.

I'm new in these things, so I need to download install files from repository
in Cake forge, but they seem to be damaged.

anybody can help me?

thanks-- ... lo esencial es invisible a los ojos ... 

--~--~-~--~~~---~--~~
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 PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: download problem

2006-09-11 Thread nate

Try making a donation ;-)

Just kidding, it should work fine with or without (but seriously, make
a donation haha).

I just checked the zip file and it seems fine.  Do you ever have issues
like this when downloading files?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Model association issue

2006-09-11 Thread Brian French

I should have elaborated more. When you view that link then go to view a 
particular user:
http://www.myclubbersguide.com/users/view/6
The associations dont seem to be working and i am now getting a php error.

(i have a view method in the users controller, but i commented it out so 
the scaffolding can do its thing)

Brian

AD7six wrote:
 Hi Brian,

 I took a peek at your link: I don´t quite understand what the problem
 is, can you elaborate?

 The sql at the foot of the page shows that sql queries are being
 executed for your associations. If you look at the user test you can
 see that there are results for each association type.

 Where is this coming from: array ( [User] = Array ( [id] = 2 [name]
 = Fan User [login] = f etc.

 if you have created a method named view in your users controller, there
 will be no scaffolding for that action.

 cheers,

 AD7six
 PS. the method pr() gives you shorter debugging code and easier to read
 output.


 


   


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Migrating to Cake and Few General Questions

2006-09-11 Thread Tony

S...no one has been able to answer my question about the roles,
having two fields (role1_id and role2_id) that relate to the roles
table. I guess what I'm trying to ask is how do you over ride
scaffolding in this situation. Is there documentation that shows me
what I need to do?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem:data retrieved from database are cached

2006-09-11 Thread jonathan

Zipman,

I was having the same problem and determined it was the browser doing
the caching.  The only way I was able to overcome this was by adding
?ms= + new Date().getTime() to my action links.  This is some
javascript that simply tacks a unique timestamp to the link to ensure
it is never cached.  For example, I use AJAX to update a div in my page
as follows:

function viewClient(id) {
new Ajax.Updater('data_client', '/myapp/clients/view/'+id+?ms= + new
Date().getTime(), {asynchronous:true});
}

I have not had an issue since implementing this.  Hope it helps...


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Controller redirect

2006-09-11 Thread Tim

Is there a way of doing a redirect from my controller which preserves
the form data?  Thanks.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



working with elements.

2006-09-11 Thread [EMAIL PROTECTED]

Hello.

I am still trying to figure out the best way to design with cake. In
general almost all my pages have mixed blocks from different
controllers on each page. (like CNN) So elements are really something
that I would like to use! It is nice that I can create very small
modules and final put it all together in static pages.

1. Elements requestAction from controllers.
2. Pages consist of fixed formatting and elements(menu, info etc).

My problem:
Page About us has e.g. two elements: menu and info.So.
What if element menu should interact with element info? I select
something in the menu - Page reloads and displays the select item in
element B! I don't understand how I should pull this off?

Best regards.
Asbjørn Morell.


PAGE:
/pages/home.thtml
?php

echo $this-renderElement('about_us\menu');

echo $this-renderElement('about_us\info');

echo $this-renderElement('cases\newest');

?

CONTROLLER:
/controllers/about_us_controller
function menu() {
return $this-Text-findAll(null, array('id', 'headline'));
}

ELEMENT:
/views/elements/about_us/menu
?php
foreach ($this-requestAction('/texts/menu') as $text)
{
echo '
li'.$html-link($text['Text']['headline'],
'/about_us/view/' . $text['Text']['id']).'/li';
}
?


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Controller redirect

2006-09-11 Thread Brian French

Use could use Sessions.

Tim wrote:
 Is there a way of doing a redirect from my controller which preserves
 the form data?  Thanks.


 

   

--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



ACM AcmController::$Session Error fix

2006-09-11 Thread Lokkju

If any of you are getting errors with the ACM plugin regarding the
Session component ($Session), take a look at
https://trac.cakephp.org/ticket/1091 - apply this to your
libs/controller/controller.php file, and it should work!


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Controller redirect

2006-09-11 Thread nate

That's more of an HTTP question, and the answer is not really.  As
Brian said, you could use sessions, i.e. $this-Session-write('Form',
$this-data);

I suppose another option would be to use requestAction to return a
different action from a different controller.


--~--~-~--~~~---~--~~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: download problem

2006-09-11 Thread Chris Lamb


Heh, I had this issue too: was copy/pasting the URL from inside
Cakeforge to use with wget, and was wondering why it was corrupted!

Maybe I should submit a ticket? ;)


-- 
 Chris Lamb, Cambs, UK  WWW: http://chris-lamb.co.uk
  Q. Why is top posting bad? GPG: 0x634F9A20
  A. Because it breaks the logical sequence of discussion


signature.asc
Description: PGP signature