Saving state between visits (waking sessions back up)

2011-04-17 Thread Greg Skerman
Ok so I want to do something which I would imagine should be fairly straight forward with sessions, but can't for the life of me find documentation to support it. Basically I want to be able to store the cake Session token in a cookie, then wake the session matching that cookie back up on a

Re: Saving state between visits (waking sessions back up)

2011-04-17 Thread Ryan Schmidt
On Apr 17, 2011, at 01:03, Greg Skerman wrote: Basically I want to be able to store the cake Session token in a cookie, then wake the session matching that cookie back up on a subsequent visit. Imagine the following scenario (not precisely what I'm doing, but a good illustration none the

Re: Anyway to change the default.ctp to another header.ctp ?

2011-04-17 Thread Chuck
thanks! Chuck On Apr 17, 4:13 am, Krissy Masters naked.cake.ba...@gmail.com wrote: You could have an if or switch block in the layout to echo an element if($logged_in){ echo $this-Element('private_header, array()); //1 element header } else { //other header element echo

Re: Enums and Select tags (newb warning)

2011-04-17 Thread euromark
this is one possible approach: http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-attributes/ On 17 Apr., 05:54, cricket zijn.digi...@gmail.com wrote: On Sat, Apr 16, 2011 at 5:34 PM, turbo2ltr turbo2...@gmail.com wrote: So I'm brand new to cakePHP, but I consider myself a

Re: Cake PHP as Multisite / Multidomain

2011-04-17 Thread Yuka Poppe
Hi List, Cricket, How would version rollout work? With a single codebase, and thus a relatively userbase, the project gets big quickly. Customers request different features, you'll look at all the feature requests and will decide to implement a few that make sense to the whole lot. There comes a

Re: Saving state between visits (waking sessions back up)

2011-04-17 Thread Yuka Poppe
Hi Greg, Ryan, On Apr 17, 2011, at 01:03, Greg Skerman wrote: User visits an online store, and puts a bunch of items in their shopping cart. User then decides to leave the store, without going through the checkout Weeks later, the user revisits the store Take a look at the builtin Session

Re: Checkbox FormHelper

2011-04-17 Thread Yuka Poppe
In case anyone ran into this, I fixed this like so: Index: libs/view/helpers/form.php === --- libs/view/helpers/form.php (revision 149) +++ libs/view/helpers/form.php (working copy) @@ -1491,12 +1491,14 @@

Related models on a single form

2011-04-17 Thread John Eke
Hi Guys, I was wondering if there was an easy way to combine models into the same form if they are related to eachother. For example say there were two models Library and Book, and they were related (Library hasMany Book) After baking all models, controllers and forms, you get the ability to

Link submission email

2011-04-17 Thread dvvbrook79
Hi I have a link submission page, and have just added a reciprocal link field...which worked fine, however i cant get to draw this information out of the field into the email that is sent to me when i have a link submittedit ends up like this.. URL: http://www.example.com Title: example

Re: Related models on a single form

2011-04-17 Thread euromark
the book covers all those simply questions: http://book.cakephp.org/de/view/1032/Saving-Related-Model-Data-hasOne-hasMany-belongsTo On 17 Apr., 07:53, John Eke john@gmail.com wrote: Hi Guys, I was wondering if there was an easy way to combine models into the same form if they are related

Re: Related models on a single form

2011-04-17 Thread Yuka Poppe
On Sun, Apr 17, 2011 at 7:53 AM, John Eke john@gmail.com wrote: I was wondering if there was an easy way to combine models into the same form if they are related to eachother. For example say there were two models Library and Book, and they were related  (Library hasMany Book) Hi John,

Re: URL Case

2011-04-17 Thread AD7six
On Apr 17, 4:06 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Apr 15, 2011, at 08:57, AD7six wrote: On Apr 15, 9:25 am, Ryan Schmidt google-2...@ryandesign.com wrote: On Apr 14, 2011, at 14:49, stas kim wrote: This might help

Re: I want to use textbox to display datetime fileld instead of drodown lists.

2011-04-17 Thread lsiden
Check out http://www.filamentgroup.com/lab/date_range_picker_using_jquery_ui_16_and_jquery_ui_css_framework/ I'm using it in a site I'm building right now. Also, check out this one, it looks pretty cool, but it may be more elaborate than you need:

Re: Cake PHP as Multisite / Multidomain

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 7:37 AM, Yuka Poppe y...@xs4all.nl wrote: Hi List, Cricket, How would version rollout work? With a single codebase, and thus a relatively userbase, the project gets big quickly. Customers request different features, you'll look at all the feature requests and will

When need to use Set::combine ?

2011-04-17 Thread Điển vũ
1. $result = Set::combine($a, array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.id'); 2. 3. /* $result now looks like: 4. Array 5. ( 6. [mariano.iglesias: Mariano Iglesias] = 2 7. [phpnut: Larry E. Masters] = 14 8. [gwoo: The Gwoo] = 25

Re: Related models on a single form

2011-04-17 Thread John Eke
Thanks a lot euromark and Yuka! Ill try that On Sun, Apr 17, 2011 at 9:22 AM, Yuka Poppe y...@xs4all.nl wrote: On Sun, Apr 17, 2011 at 7:53 AM, John Eke john@gmail.com wrote: I was wondering if there was an easy way to combine models into the same form if they are related to eachother.

Re: Saving state between visits (waking sessions back up)

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 2:03 AM, Greg Skerman gsker...@gmail.com wrote: Ok so I want to do something which I would imagine should be fairly straight forward with sessions, but can't for the life of me find documentation to support it. Basically I want to be able to store the cake Session

Re: When need to use Set::combine ?

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 3:37 PM, Điển vũ meotimdi...@gmail.com wrote: $result = Set::combine($a, array('{0}: {1}', '{n}.User.Data.user', '{n}.User.Data.name'), '{n}.User.id'); /* $result now looks like: Array ( [mariano.iglesias: Mariano Iglesias] = 2 [phpnut: Larry E. Masters] = 14 [gwoo:

Re: Link submission email

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 9:17 AM, dvvbrook79 c...@disneyvillavacations.com wrote: Hi I have a link submission page, and have just added a reciprocal link field...which worked fine, however i cant get to draw this information out of the field into the email that is sent to me when i have a

Tr.lời: Re: When need to use Set::combine ?

2011-04-17 Thread Điển vũ
It may be 2 question : when use Set::combine and extract this data : $this-User-find('all); 1. Array ( [0] = Array ( [User] = Array ( [id] = 4 [username] = myname [password]

Re: Enums and Select tags (newb warning)

2011-04-17 Thread turbo2ltr
Thanks! This worked. -Mike On Apr 16, 8:54 pm, cricket zijn.digi...@gmail.com wrote: On Sat, Apr 16, 2011 at 5:34 PM, turbo2ltr turbo2...@gmail.com wrote: So I'm brand new to cakePHP, but I consider myself a pretty decent php developer.  I'm trying to give it time to soak in, but at this

Re: URL Case

2011-04-17 Thread Ryan Schmidt
On Apr 17, 2011, at 10:44, AD7six wrote: On Apr 17, 4:06 am, Ryan Schmidt wrote: On Apr 15, 2011, at 08:57, AD7six wrote: $_GET['url'] = strtolower($_GET['url']); anywhere (e.g., line 1 of your index.php) will do the deed - and if you put a canonical meta tag in your page, you avoid any

Re: URL Case

2011-04-17 Thread Pablo Viojo
at line 2 of index.php if ($_SERVER['REQUEST_URI']!=strtolower($_SERVER['REQUEST_URI'])){ header(HTTP/1.1 301 Moved Permanently ); header(Location: . strtolower($_SERVER['REQUEST_URI'])); } (from memory, maybe something is wrong) Saludos, Pablo Viojo CTO, Groupon Latinoamerica

Re: URL Case

2011-04-17 Thread Pablo Viojo
Regarding the $_GET['url'] question, check the webroot/.htaccess file, especially the line: RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] This is used by cakephp to handle friendly urls Saludos, Pablo Viojo CTO, Groupon Latinoamerica pablo.vi...@groupon.com http://www.groupon.com.ar

Re: nocache breaks when used in loop

2011-04-17 Thread Brian Sweeney
On Sat, Apr 16, 2011 at 1:47 PM, cricket zijn.digi...@gmail.com wrote: On Fri, Apr 15, 2011 at 3:37 PM, Brian Sweeney eclecticg...@gmail.com wrote: On Fri, Apr 15, 2011 at 2:47 PM, cricket zijn.digi...@gmail.com wrote: What the heck is this?! echo ?php $product_id = $product_id; ?; ?

Vs Echo

2011-04-17 Thread Krissy Masters
This might be rather dumb, but all the same. ?php echo $var;? vs ?php __($var); ? From reading __() is for l10n i18n type translate type setup but if used just to echo a var is there a downside? Performance issue, just plain wrong? Thanks, K -- Our newest site for the

Re: Tr.lời: Re: When need to use Set::combine ?

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 4:46 PM, Điển vũ meotimdi...@gmail.com wrote: It may be 2 question : when use Set::combine and  extract this data : $this-User-find('all); Array ( [0] = Array ( [User] = Array ( [id] = 4

Re: nocache breaks when used in loop

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 9:19 PM, Brian Sweeney eclecticg...@gmail.com wrote: Speaking of expires headers ... if a view is cached does cake return an expires header for it? The content does have an expiration so it seems like this would be plausible. No. At least, not that I'm aware of. Look

Re: Vs Echo

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 10:11 PM, Krissy Masters naked.cake.ba...@gmail.com wrote: This might be rather dumb, but all the same… ?php echo $var;?  vs ?php  __($var); ? From reading __() is for l10n  i18n type translate type setup but if used just to echo a var is there a downside?

Re: Saving state between visits (waking sessions back up)

2011-04-17 Thread Greg Skerman
Thanks guys, that makes sense... Wasn't entirely sure if sessions were the way to go or not... one question Cricket, if the token is in a long lived cookie, why write just the token to the session? isn't checking both a little redundant? that is the token itself, not the rest of the data stored

Re: Vs Echo

2011-04-17 Thread Ryan Schmidt
On Apr 17, 2011, at 21:11, Krissy Masters wrote: This might be rather dumb, but all the same… ?php echo $var;? vs ?php __($var); ? From reading __() is for l10n i18n type translate type setup but if used just to echo a var is there a downside? Performance issue, just plain wrong?

RE: Vs Echo

2011-04-17 Thread Krissy Masters
Thanks for the details! That's all I was curious about. K -Original Message- From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Ryan Schmidt Sent: Monday, April 18, 2011 12:56 AM To: cake-php@googlegroups.com Subject: Re: Vs Echo On Apr 17, 2011, at 21:11,

Re: Saving state between visits (waking sessions back up)

2011-04-17 Thread cricket
On Sun, Apr 17, 2011 at 11:02 PM, Greg Skerman gsker...@gmail.com wrote: Thanks guys, that makes sense... Wasn't entirely sure if sessions were the way to go or not... one question Cricket, if the token is in a long lived cookie, why write just the token to the session? isn't checking both a