Re: 3.0: a peek into CakePHP's future

2012-07-09 Thread Jamescowhen
I would think moving to a more object oriented model will result in better 
readable code and IDE auto completion will be more useful. 

On Sunday, July 8, 2012 7:12:32 PM UTC-7, Greg wrote:
>
> For mine, being able to deal with objects in the view would greatly 
> improve the readability of data (the whole $user['User']['email'] etc looks 
> incredibly difficult to read to me, compared with $user->email which would 
> be much nicer).
>
> I've always felt dealing with arrays is a bit of a 'hack'. I understand 
> the choice, but I think the idea to move towards a more object oriented 
> approach is more than hype, and long overdue.
>
>
> On Sat, Jul 7, 2012 at 7:35 PM, tigr  wrote:
>
>> No, that is not "nice". The strength of the CakePHP design is in being 
>> very straightforward when it comes to working with the data. I have seen 
>> other frameworks and I think that object-oriented ways are not suitable for 
>> working with data. Well, of course, you can, but would you want to, given a 
>> choice? My answer was "no" and that is why I am using Cake. I am worried 
>> that the object-oriented hype will get the best of you and we will lose a 
>> perfectly sensible data processing framework to the object-oriented glory. 
>> For practical reasons, it would be great to leave the model layer 
>> principles as they are.
>>
>>  -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>> at http://groups.google.com/group/cake-php
>>
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Automatic coercion when reading string database data

2012-06-14 Thread JamesCowhen
I'm having the same issue.

 I discovered today that when I try to use cakephp as a webservice provider 
that returns json, it turns all the results into strings. It's all traced 
backed to the results returned by models being all strings.

To me this is a serious problem as you pointed out. It leaves me to coerce 
the data type either in the clients in ios or insert ugly coercion code 
before the data is serialized into json. 

I always thought cakephp would use inference to convert to the right data 
type when looking at the table structure. This doesn't appear to be working.

The manual document the $_schema property that allows users to specifies 
the type, this also seemed to be ignored as well. 





On Monday, June 11, 2012 7:31:48 PM UTC-7, Brad Koch wrote:
>
> I'm currently facing an issue regarding the data types being read from the 
> database.  Regardless of the type specified in the schema definition, all 
> data is read in as a string.  It's a well documented issue.  The encoding 
> of numbers as strings wrecks general havoc when it gets converted to JSON 
> and hits the client side code.
>
> My intended solution is to write a behavior that utilizes Model::_schema 
> to automatically sanitize the results.  However, I don't want to go out and 
> reinvent the wheel if there's a solution out there I don't know about yet.
>
> Is anyone aware of a CakePHP framework feature / library that correctly 
> sanitizes the database input?
>
> -- 
> Brad Koch
>
>  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cookie tutorial

2008-10-30 Thread jamescowhen

Awesome, should add that to the cakephp books

On Oct 28, 1:34 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> i figured it out.
>
> it works if put the following lines in beforeFilter() of the
> controller (don't put it in app_controller.php)
>
> $this->Cookie->name = 'location';
>   $this->Cookie->time =  3600;  // or '1 hour'
>   $this->Cookie->path = '/';
>   $this->Cookie->domain = 'localhost';
>   $this->Cookie->secure = true;  //i.e. only sent if using secure
> HTTPS
>   $this->Cookie->key = 'qSI232qs*&sXOw!';
>
> On Oct 23, 11:44 pm, . <[EMAIL PROTECTED]> wrote:
>
> > Is there a cake ticket for this? Or a possible fix?
>
> > On Thu, Oct 23, 2008 at 2:47 AM, jamescowhen <[EMAIL PROTECTED]> wrote:
>
> > > I have the same issue, removing the domain seem to fix it, but that
> > > doesn't get at the root of the problem
>
> > > On Oct 21, 11:31 pm, . <[EMAIL PROTECTED]> wrote:
> > > > same here.. so you still are leaving out the domain variable?
>
> > > > On Tue, Oct 21, 2008 at 11:13 AM, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > > > > I had a problem with cookies a while back. Couldn't seem to reference
> > > > > them after I saved them. I know the docs say the domain variable is
> > > > > required, but as soon as removed it, everything started working as
> > > > > expected.
>
> > > > > On Oct 20, 1:27 am, . <[EMAIL PROTECTED]> wrote:
> > > > > > I don't think it is saving the cookie, because if i go to another
> > > page,
> > > > > > doing $this->Cookie->read('name') returns null... how do i persist
> > > the
> > > > > > cookie?
>
> > > > > > On Sun, Oct 19, 2008 at 11:25 PM, . <[EMAIL PROTECTED]> wrote:
> > > > > > >  $this->Cookie->name = 'location';
> > > > > > >   $this->Cookie->time =  3600;  // or '1 hour'
> > > > > > >   $this->Cookie->path = '/';
> > > > > > >   $this->Cookie->domain = 'localhost';
> > > > > > >   $this->Cookie->secure = true;  //i.e. only sent if using secure
> > > HTTPS
> > > > > > >   $this->Cookie->key = 'qSI232qs*&sXOw!';
>
> > > > > > >  $this->Cookie->write('name','Larry');
>
> > > > > > > if I do the above, where is the cookie "location" saved to? I did 
> > > > > > > a
> > > > > search
> > > > > > > on my HDD but cannot find the file.
>
> > > > > > > On Sun, Oct 19, 2008 at 11:03 PM, Daniel Hofstetter <
> > > > > [EMAIL PROTECTED]>wrote:
>
> > > > > > >> Hi,
>
> > > > > > >> > is there any tutorial about cookie component for cakephp? i am
> > > > > having
> > > > > > >> > trouble using it.
>
> > > > > > >>http://book.cakephp.org/view/177/Cookies
>
> > > > > > >> Hope that helps!
>
> > > > > > >> --
> > > > > > >> Daniel Hofstetter
> > > > > > >>http://cakebaker.42dh.com-Hide quoted text -
>
> > - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~--~~~~--~~--~--~---



Re: cookie tutorial

2008-10-23 Thread jamescowhen

I have the same issue, removing the domain seem to fix it, but that
doesn't get at the root of the problem

On Oct 21, 11:31 pm, . <[EMAIL PROTECTED]> wrote:
> same here.. so you still are leaving out the domain variable?
>
> On Tue, Oct 21, 2008 at 11:13 AM, Stinkbug <[EMAIL PROTECTED]> wrote:
>
> > I had a problem with cookies a while back. Couldn't seem to reference
> > them after I saved them. I know the docs say the domain variable is
> > required, but as soon as removed it, everything started working as
> > expected.
>
> > On Oct 20, 1:27 am, . <[EMAIL PROTECTED]> wrote:
> > > I don't think it is saving the cookie, because if i go to another page,
> > > doing $this->Cookie->read('name') returns null... how do i persist the
> > > cookie?
>
> > > On Sun, Oct 19, 2008 at 11:25 PM, . <[EMAIL PROTECTED]> wrote:
> > > >  $this->Cookie->name = 'location';
> > > >   $this->Cookie->time =  3600;  // or '1 hour'
> > > >   $this->Cookie->path = '/';
> > > >   $this->Cookie->domain = 'localhost';
> > > >   $this->Cookie->secure = true;  //i.e. only sent if using secure HTTPS
> > > >   $this->Cookie->key = 'qSI232qs*&sXOw!';
>
> > > >  $this->Cookie->write('name','Larry');
>
> > > > if I do the above, where is the cookie "location" saved to? I did a
> > search
> > > > on my HDD but cannot find the file.
>
> > > > On Sun, Oct 19, 2008 at 11:03 PM, Daniel Hofstetter <
> > [EMAIL PROTECTED]>wrote:
>
> > > >> Hi,
>
> > > >> > is there any tutorial about cookie component for cakephp? i am
> > having
> > > >> > trouble using it.
>
> > > >>http://book.cakephp.org/view/177/Cookies
>
> > > >> Hope that helps!
>
> > > >> --
> > > >> Daniel Hofstetter
> > > >>http://cakebaker.42dh.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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?hl=en
-~--~~~~--~~--~--~---