RE: Help with array

2010-11-03 Thread Dave Maharaj
No, Im taking over an old site someone else built and they have some custom
javascript that allows users to drag crap around and they wanted to save
some of the data information on that. No jquery since it was custom code
they used so I needed a quick way to simply pass that data off to the
controller. No forms, no actual fields. I just called it field and used the
#id name as the field ($something = the something field in the db I was
going to save) and took that along with the object.

I know made no sense but I was stuck and need something quick.

But that's all done now.

Thanks all

Dave

-Original Message-
From: cricket [mailto:zijn.digi...@gmail.com] 
Sent: November-04-10 2:33 AM
To: cake-php@googlegroups.com
Subject: Re: Help with array

On Wed, Nov 3, 2010 at 9:57 PM, Dave Maharaj  wrote:
>
> It has a model. Im using a jquery plugin and where the user slides
something
> I have a #id which corresponds to a field and a value so I want to save it
> but it has no built in way to save that data so that's what im trying to
do!

Couldn't you create a hidden form? Update the form element
corresponding to the field based on your slider position and submit.

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Help with array

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 9:57 PM, Dave Maharaj  wrote:
>
> It has a model. Im using a jquery plugin and where the user slides something
> I have a #id which corresponds to a field and a value so I want to save it
> but it has no built in way to save that data so that’s what im trying to do!

Couldn't you create a hidden form? Update the form element
corresponding to the field based on your slider position and submit.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Can i send email through mysql/cakephp when the users are offline?

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 11:52 PM, Jerin K Alexander
 wrote:
> No, i need not detect the offline users. in this ,i am creating an
> event (with some conditions)and it set to a particular time . It will
> execute at that particular time when the conditions are true at that
> time. Means it will an insertion,or deletion, whatever may be.. so at
> that particular time may be their is no users at online(may be). So i
> need to send a mail to administrator about this. so please help..

You could create a cron job.

But you still seem to be saying that you want to test whether there
are any users online. And, if there was an insert/delete, wouldn't
that suggest that at least one user was online?

Maybe it would help if you explained further about what you are trying
to achieve.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Anyone care to help with Media Temple dv?

2010-11-03 Thread td-nathan
You can put it anywhere, but the default security restrictions keep
you from accessing anything outside of httpdocs.  These can easily be
changed in the php.ini file or on a per-domain basis in the vhost.conf
file.  The setting you'd be looking for would be to set
open_basedir=none

As far as permissions, you need to 777 the tmp/ directory and
subdirectories

Hope that helps,
Nathan

On Nov 3, 9:35 am, "Dave Maharaj"  wrote:
> Hey thanks.
>
> Ok htaccess is there and site is up but cache not writable is next
> errorsplenty of those.
>
> Did some reading and to me it looked like I had np option but to put "cake"
> folder in httpdocs?Weird no? I was on their (gs) server and was able to move
> my folder outside of the root folder but on a higher end server more $$$ I
> have to keep it in root folder?
>
> Im no server giuy so please bare with me...any and all tips / advice will be
> greatly appreciated.
> Thanks,
>
> Dave
>
>
>
> -Original Message-
> From: td-nathan [mailto:tyler.digi...@gmail.com]
> Sent: November-03-10 4:12 AM
> To: CakePHP
> Subject: Re: Anyone care to help with Media Temple dv?
>
> Try the .htaccess first, next I'd look at php.ini settings like
> safemode or basedir restrictions depending on where you placed the
> cake install relative to httpdocs
>
> -Nathan
>
> On Nov 2, 7:25 pm, "Dave Maharaj"  wrote:
> > I had my site on Media Temple gs service no problem. Now moving it to dv
> and
> > I got nothing. Uploaded everything but no htaccess file appears so I think
> > that might be part of the problem. Get no error message other than 500
> > server error.
>
> > Any ideas / help would be great as I cant seem to find anything.
>
> > Dave
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Help with array

2010-11-03 Thread Dave Maharaj
Shit on it close enough.

var sub_data = { data: { field: field_id, value: sub_val } };

send it off and good enough.

Thanks again, I know it was an out of the norm question.

Dave

-Original Message-
From: Miles J [mailto:mileswjohn...@gmail.com] 
Sent: November-03-10 11:34 PM
To: CakePHP
Subject: Re: Help with array

Wouldnt this work? Havent tried.

var data = { Model: { username: 'miles'; } }

On Nov 3, 6:57 pm, "Dave Maharaj"  wrote:
> I think so!
>
> It has a model. Im using a jquery plugin and where the user slides
something
> I have a #id which corresponds to a field and a value so I want to save it
> but it has no built in way to save that data so that's what im trying to
do!
>
> So I want to mimic what that looks like. I only asked a question! If you
> want to be a comic maybe you should give that a try. It is a help forum is
> it not? If we were all as skilled as you then who would you insult?
>
> From: Matt Murphy [mailto:mattyh...@gmail.com]
> Sent: November-03-10 11:21 PM
> To: cake-php@googlegroups.com
> Subject: Re: Help with array
>
> Am I being moronic, everyone?
>
> Matt
>
> On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:
>
> It's your data.  Make a model for it.
>
> On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:
>
> Does anyone know how to manually create an array in js that would mimic
the
> data sent normally?
>
> I simply need to send off 1 key => value pair  so it looks like
> data['model']['field'] => 0 since that is what the controller is expecting
>
> Not using a form as what is being done is not possible..
>
> The js has field value passed to it.just cant seem to get the array right.
>
> SCRIPT (NOT CONTROLLER)
>
> function update ( field , value ) {
>
> var user_data= new Array()
>
>                 
>
> $.ajax({
>
>                                 type: "POST",
>
>                                 cache:false,
>
>                                 url: '/user/update',
>
>                                 data:   user_data
>
> });                          
> }
>
> Thanks,
>
> Dave
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com
>   For more options, visit
> this group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Can i send email through mysql/cakephp when the users are offline?

2010-11-03 Thread Jerin K Alexander
No, i need not detect the offline users. in this ,i am creating an
event (with some conditions)and it set to a particular time . It will
execute at that particular time when the conditions are true at that
time. Means it will an insertion,or deletion, whatever may be.. so at
that particular time may be their is no users at online(may be). So i
need to send a mail to administrator about this. so please help..

On Nov 3, 10:58 pm, Miles J  wrote:
> No there isn't such functionality.
>
> Furthermore, how are you detecting an "offline" user?
>
> On Nov 2, 9:03 pm, Jerin K Alexander 
> wrote:
>
>
>
>
>
>
>
> > My objective is tosenda mail when the users are offline. It depends
> > on a particular row or value inserted in the table. if such an option
> > provide by cake or mysql,please help me..

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Help with array

2010-11-03 Thread Dave Maharaj
Nope. This is where I get stuck.

var sub_data = { data: { Setting: { "field": sub_val } } };

I always get data[Setting][field] = the correct value

field and sub_val are variables so sub_val prints out value 1,2,3 or what
not but field always gets printed as field, even though field is not field
(field might be "restricted", "allow", "foreign" so I should end up with
data[Setting][restricted] or one of the fields.

So that’s where I am stuck.

Thanks again,

Dave

-Original Message-
From: Miles J [mailto:mileswjohn...@gmail.com] 
Sent: November-03-10 11:34 PM
To: CakePHP
Subject: Re: Help with array

Wouldnt this work? Havent tried.

var data = { Model: { username: 'miles'; } }

On Nov 3, 6:57 pm, "Dave Maharaj"  wrote:
> I think so!
>
> It has a model. Im using a jquery plugin and where the user slides
something
> I have a #id which corresponds to a field and a value so I want to save it
> but it has no built in way to save that data so that's what im trying to
do!
>
> So I want to mimic what that looks like. I only asked a question! If you
> want to be a comic maybe you should give that a try. It is a help forum is
> it not? If we were all as skilled as you then who would you insult?
>
> From: Matt Murphy [mailto:mattyh...@gmail.com]
> Sent: November-03-10 11:21 PM
> To: cake-php@googlegroups.com
> Subject: Re: Help with array
>
> Am I being moronic, everyone?
>
> Matt
>
> On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:
>
> It's your data.  Make a model for it.
>
> On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:
>
> Does anyone know how to manually create an array in js that would mimic
the
> data sent normally?
>
> I simply need to send off 1 key => value pair  so it looks like
> data['model']['field'] => 0 since that is what the controller is expecting
>
> Not using a form as what is being done is not possible..
>
> The js has field value passed to it.just cant seem to get the array right.
>
> SCRIPT (NOT CONTROLLER)
>
> function update ( field , value ) {
>
> var user_data= new Array()
>
>                 
>
> $.ajax({
>
>                                 type: "POST",
>
>                                 cache:false,
>
>                                 url: '/user/update',
>
>                                 data:   user_data
>
> });                          
> }
>
> Thanks,
>
> Dave
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com
>   For more options, visit
> this group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Help with array

2010-11-03 Thread Matt Murphy
Yeah.  Sorry you got yourself in a huff over that.  Let me expand slightly.
The idea is to arrange the data using a model, then call the model in the
controller and it will be formatted in the expected way.  I believe there
are actually examples of this in the bakery, and I'm sure I've seen them in
PAKT Publishing's 2 or 3 CakePHP books.
Or don't.  It just strikes me as the "MVC" way to do it.

Cheers,
Matt

On Wed, Nov 3, 2010 at 9:57 PM, Dave Maharaj  wrote:

>  I think so!
>
>
>
> It has a model. Im using a jquery plugin and where the user slides
> something I have a #id which corresponds to a field and a value so I want to
> save it but it has no built in way to save that data so that’s what im
> trying to do!
>
>
>
> So I want to mimic what that looks like. I only asked a question! If you
> want to be a comic maybe you should give that a try. It is a help forum is
> it not? If we were all as skilled as you then who would you insult?
>
>
>
> *From:* Matt Murphy [mailto:mattyh...@gmail.com]
> *Sent:* November-03-10 11:21 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: Help with array
>
>
>
> Am I being moronic, everyone?
>
> Matt
>
> On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:
>
> It's your data.  Make a model for it.
>
>
>
> On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:
>
> Does anyone know how to manually create an array in js that would mimic the
> data sent normally?
>
> I simply need to send off 1 key => value pair  so it looks like
> data[‘model’][‘field’] => 0 since that is what the controller is expecting
>
>
>
> Not using a form as what is being done is not possible….
>
>
>
> The js has field value passed to it…just cant seem to get the array right.
>
>
>
>
>
> SCRIPT (NOT CONTROLLER)
>
> function update ( field , value ) {
>
>
>
> var user_data= new Array()
>
> 
>
>
>
> $.ajax({
>
> type: "POST",
>
> cache:false,
>
> url: '/user/update',
>
> data:   user_data
>
> });
>
> }
>
>
>
> Thanks,
>
>
>
> Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
>
>
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Help with array

2010-11-03 Thread Dave Maharaj
Will give it a try. 

Thanks Miles

Dave



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Help with array

2010-11-03 Thread Miles J
Wouldnt this work? Havent tried.

var data = { Model: { username: 'miles'; } }

On Nov 3, 6:57 pm, "Dave Maharaj"  wrote:
> I think so!
>
> It has a model. Im using a jquery plugin and where the user slides something
> I have a #id which corresponds to a field and a value so I want to save it
> but it has no built in way to save that data so that's what im trying to do!
>
> So I want to mimic what that looks like. I only asked a question! If you
> want to be a comic maybe you should give that a try. It is a help forum is
> it not? If we were all as skilled as you then who would you insult?
>
> From: Matt Murphy [mailto:mattyh...@gmail.com]
> Sent: November-03-10 11:21 PM
> To: cake-php@googlegroups.com
> Subject: Re: Help with array
>
> Am I being moronic, everyone?
>
> Matt
>
> On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:
>
> It's your data.  Make a model for it.
>
> On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:
>
> Does anyone know how to manually create an array in js that would mimic the
> data sent normally?
>
> I simply need to send off 1 key => value pair  so it looks like
> data['model']['field'] => 0 since that is what the controller is expecting
>
> Not using a form as what is being done is not possible..
>
> The js has field value passed to it.just cant seem to get the array right.
>
> SCRIPT (NOT CONTROLLER)
>
> function update ( field , value ) {
>
> var user_data= new Array()
>
>                 
>
> $.ajax({
>
>                                 type: "POST",
>
>                                 cache:false,
>
>                                 url: '/user/update',
>
>                                 data:   user_data
>
> });                          
> }
>
> Thanks,
>
> Dave
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com
>   For more options, visit
> this group athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Help with array

2010-11-03 Thread Dave Maharaj
I think so!

 

It has a model. Im using a jquery plugin and where the user slides something
I have a #id which corresponds to a field and a value so I want to save it
but it has no built in way to save that data so that's what im trying to do!

 

So I want to mimic what that looks like. I only asked a question! If you
want to be a comic maybe you should give that a try. It is a help forum is
it not? If we were all as skilled as you then who would you insult?

 

From: Matt Murphy [mailto:mattyh...@gmail.com] 
Sent: November-03-10 11:21 PM
To: cake-php@googlegroups.com
Subject: Re: Help with array

 

Am I being moronic, everyone?

Matt

On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:

It's your data.  Make a model for it.

 

On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:

Does anyone know how to manually create an array in js that would mimic the
data sent normally? 

I simply need to send off 1 key => value pair  so it looks like
data['model']['field'] => 0 since that is what the controller is expecting

 

Not using a form as what is being done is not possible..

 

The js has field value passed to it.just cant seem to get the array right.

 

 

SCRIPT (NOT CONTROLLER)

function update ( field , value ) {

 

var user_data= new Array()



 

$.ajax({

type: "POST",

cache:false,

url: '/user/update',

data:   user_data 

});   

}

 

Thanks,

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.
 
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
cake-php+unsubscr...@googlegroups.com
  For more options, visit
this group at http://groups.google.com/group/cake-php?hl=en

 

 

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.
 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Help with array

2010-11-03 Thread Matt Murphy
Am I being moronic, everyone?

Matt

On Wed, Nov 3, 2010 at 9:50 PM, Matt Murphy  wrote:

> It's your data.  Make a model for it.
>
>
> On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:
>
>>  Does anyone know how to manually create an array in js that would mimic
>> the data sent normally?
>>
>> I simply need to send off 1 key => value pair  so it looks like
>> data[‘model’][‘field’] => 0 since that is what the controller is expecting
>>
>>
>>
>> Not using a form as what is being done is not possible….
>>
>>
>>
>> The js has field value passed to it…just cant seem to get the array right.
>>
>>
>>
>>
>>
>> SCRIPT (NOT CONTROLLER)
>>
>> function update ( field , value ) {
>>
>>
>>
>> var user_data= new Array()
>>
>> 
>>
>>
>>
>> $.ajax({
>>
>> type: "POST",
>>
>> cache:false,
>>
>> url: '/user/update',
>>
>> data:   user_data
>>
>> });
>>
>> }
>>
>>
>>
>> Thanks,
>>
>>
>>
>> Dave
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Help with array

2010-11-03 Thread Matt Murphy
It's your data.  Make a model for it.

On Wed, Nov 3, 2010 at 8:18 PM, Dave Maharaj  wrote:

>  Does anyone know how to manually create an array in js that would mimic
> the data sent normally?
>
> I simply need to send off 1 key => value pair  so it looks like
> data[‘model’][‘field’] => 0 since that is what the controller is expecting
>
>
>
> Not using a form as what is being done is not possible….
>
>
>
> The js has field value passed to it…just cant seem to get the array right.
>
>
>
>
>
> SCRIPT (NOT CONTROLLER)
>
> function update ( field , value ) {
>
>
>
> var user_data= new Array()
>
> 
>
>
>
> $.ajax({
>
> type: "POST",
>
> cache:false,
>
> url: '/user/update',
>
> data:   user_data
>
> });
>
> }
>
>
>
> Thanks,
>
>
>
> Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Help with array

2010-11-03 Thread Dave Maharaj
Does anyone know how to manually create an array in js that would mimic the
data sent normally? 

I simply need to send off 1 key => value pair  so it looks like
data['model']['field'] => 0 since that is what the controller is expecting

 

Not using a form as what is being done is not possible..

 

The js has field value passed to it.just cant seem to get the array right.

 

 

SCRIPT (NOT CONTROLLER)

function update ( field , value ) {

 

var user_data= new Array()



 

$.ajax({

type: "POST",

cache:false,

url: '/user/update',

data:   user_data 

});   

}

 

Thanks,

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How strict is your approach towards convention over configuration?

2010-11-03 Thread Enno Weichert
sorry I started two threads...
"How do I map legacy _field_ names to better suited (read Cake-like)
ones?" is the other one.

short: Cake will play nice with anything the problem is: the field
names are horrible and I don't want to see them.
But (as I posted in the other thread) there are some problems:
1. I cannot use mysql views
2. I cannot change the schema
3. I cannot do my own thing
4. just introducing the table name, id and foreign keys is not enough
given the horrible field names - I'd also have to promote different
ones for them

I thought of doing something nifty on the ORM level or something...

also: I'd love to close that thread... ;-)

On Wed, Nov 3, 2010 at 8:17 PM, nurvzy  wrote:
> That's really clever AD. I was going to say you can edit all custom
> foreign keys in the models and joins and cakephp will play nice, but
> creating database views is a pretty slick approach I hadn't thought
> of.
>
> Nick
>
> On Nov 3, 8:39 am, AD7six  wrote:
>> On Nov 3, 9:32 am, Enno Weichert  wrote:
>>
>> > Hi,
>>
>> > I have to integrate a very bad legacy database where field names are
>> > named inconsistently (like contact, Kontakt, contactID, contact_id,
>> > KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
>> > one table).
>> > I would have to reflect all that in the models so I'd not have to use
>> > that crap anymore.
>> > So: how many of the fied references in your code are hard-coded? What
>> > obstacles will I see? How much can I configure and still play cakephp?
>>
>> > Thanks,
>> > Enno
>>
>> why don't you just create a view (assuming you can't edit the actual
>> tables).
>>
>> I.e. CREATE OR REPLACE· v_tablename AS as SELECT  funky AS id, ext AS
>> group_id  FROM optionalotherdatabase.tablename
>>
>> and use that instead of the real table. If you create simple views (no
>> joins, basically) you can also update them.
>>
>> AD
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How do I map legacy _field_ names to better suited (read Cake-like) ones?

2010-11-03 Thread Enno Weichert
the legacy app will remain. sadly... Changing the schema is out of the
question. also sadly...

On Wed, Nov 3, 2010 at 9:31 PM, cricket  wrote:
> On Wed, Nov 3, 2010 at 10:01 AM, Enno Weichert
>  wrote:
>> As mentioned in my previous post I have a pretty ugly legacy database
>> to work with.
>> Examples: contact_id is contact, contactid, kontakt, kontaktid etc.
>> In one table "ext" is actually the group_id field...
>>
>> I want to map these field names so I won't have to use them anymore in
>> the application except for the model.
>> The problem is I cannot use views on the database (mysql) side so I'll
>> have to do this in the model.
>>
>> However, I cannot wrap my mind around the thing.
>> $_schema seems to get overwritten by whatever is in the table and I
>> cannot see which callback would work so I can do this properly in the
>> model.
>>
>> I cannot believe I'm the first one encountering this problem but I
>> couldn't find anything on the web :-/
>>
>> Mind you: this isn't about table names, foreign keys or primary keys
>> that part was pretty straight forward and worked out pretty well!
>
> I don't know how to answer your specific question but could you change
> the DB schema? I've run into this issue a number of times and simply
> imported the data from the old DB to new. Of course, if there will
> remain legacy code that must interact with the DB this is a
> non-starter.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Acl and bindNode

2010-11-03 Thread Jeremy Burns | Class Outfit
I'm still really hoping that someone with some inside knowledge can shed a 
light on this for me.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 1 Nov 2010, at 07:24, Jeremy Burns | Class Outfit wrote:

> Because the users table has a group_id on it.
> 
> Jeremy Burns
> Class Outfit
> 
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
> 
> On 31 Oct 2010, at 14:48, huoxito wrote:
> 
>> Guess I dont get your point.
>> 
>> Users still must de added on Aro's table, otherwise how would your
>> system know that an user A belongs to group ALFA ?
>> 
>> On 29 out, 08:23, Jeremy Burns | Class Outfit
>>  wrote:
>>> Anybody else got any more ideas on this? Anyone using it with success?
>>> 
>>> Jeremy Burns
>>> Class Outfit
>>> 
>>> jeremybu...@classoutfit.com
>>> (t) +44 (0) 208 123 3822
>>> (m) +44 (0) 7973 481949
>>> Skype: jeremy_burnshttp://www.classoutfit.com
>>> 
>>> On 27 Oct 2010, at 17:10, Jeremy Burns | Class Outfit wrote:
>>> 
>>> 
>>> 
 I wish that were the case, but the guide then gives an example of the aros 
 table, which only includes 
 groups:http://book.cakephp.org/view/1547/Acts-As-a-Requester
>>> 
 Jeremy Burns
 Class Outfit
>>> 
 jeremybu...@classoutfit.com
 http://www.classoutfit.com
>>> 
 On 27 Oct 2010, at 13:41, cricket wrote:
>>> 
> On Tue, Oct 26, 2010 at 4:40 PM, Jeremy Burns
>  wrote:
>> According to the online tutorial:
>>> 
>> "
>> In case we want simplified per-group only permissions, we need to
>> implement bindNode() in User model.
>> Code View
>>> 
>> function bindNode($user) {
>>   return array('Group' => array('id' => $user['User']['group_id']));
>> }
>>> 
>>  function bindNode($user) {
>> return array('Group' => array('id' => $user['User']
>> ['group_id']));
>>  }
>>> 
>> This method will tell ACL to skip checking User Aro's and to check
>> only Group Aro's.
>> "
>>> 
>> I've done this but I'm still getting users added to the aros table.
>> What am I missing?
>>> 
> I believe that's normal. Users will still be present in aros but the
> point is that ACL won't /check/ User, but Group.
>>> 
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> with their CakePHP related questions.
>>> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en
>>> 
 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
 with their CakePHP related questions.
>>> 
 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
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en
>> 
>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>> with their CakePHP related questions.
>> 
>> 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
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php?hl=en
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How do I map legacy _field_ names to better suited (read Cake-like) ones?

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 10:01 AM, Enno Weichert
 wrote:
> As mentioned in my previous post I have a pretty ugly legacy database
> to work with.
> Examples: contact_id is contact, contactid, kontakt, kontaktid etc.
> In one table "ext" is actually the group_id field...
>
> I want to map these field names so I won't have to use them anymore in
> the application except for the model.
> The problem is I cannot use views on the database (mysql) side so I'll
> have to do this in the model.
>
> However, I cannot wrap my mind around the thing.
> $_schema seems to get overwritten by whatever is in the table and I
> cannot see which callback would work so I can do this properly in the
> model.
>
> I cannot believe I'm the first one encountering this problem but I
> couldn't find anything on the web :-/
>
> Mind you: this isn't about table names, foreign keys or primary keys
> that part was pretty straight forward and worked out pretty well!

I don't know how to answer your specific question but could you change
the DB schema? I've run into this issue a number of times and simply
imported the data from the old DB to new. Of course, if there will
remain legacy code that must interact with the DB this is a
non-starter.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Basic issue with HABTM

2010-11-03 Thread cricket
On Tue, Nov 2, 2010 at 8:47 PM, Fernando Barrocal  wrote:
> Some updates on here (paste bins are used to delete my post even when I ask
> to mantain)
> /* Tables /*
> users              people           contacts
> -- 1<--->1  n<--->n --
> id                 id               id
> username           user_id          phone
>                    f_name
> Yes, there is a people_contacts table with both Ids
> /* View */
>  echo $this->Form->create('User');
> echo $this->Form->input('username');
> echo $this->Form->input('Person.f_name');
> echo $this->Form->input('Contact.0.phone');
> echo $this->Form->end(__('Submit', true));
> ?>
> /* Controller */
> function register($step = "create_account") {
>   if (!empty($this->data)) {
>     $this->User->create();
>     if ($this->User->saveAll($this->data)) {
>       $this->Session->setFlash(__('The user has been saved', true));
>     } else {
>       $this->Session->setFlash(__('The user could not be saved.', true));
>     }
>   }
> }
>
> On Tue, Nov 2, 2010 at 22:15, Fernando Barrocal  wrote:
>>
>> Hi guys,
>> I am having some trouble with pretty basic things but it took me precious
>> hours today, and I decided to ask for some light ...
>> I have this config that I am trying to make work:
>> http://bin.cakephp.org/view/2004163346
>> I baked everything with cake bake and I need a way to proper save all 3
>> models on submit
>>
>> Any hints or ideas ?
>>
>> --
>> Fernando Barrocal 
>> +55 11 8257-7200
>> +55 11 3020-7332
>> skype: fbarrocal
>
>
>
> --
> Fernando Barrocal 
> +55 11 8257-7200
> +55 11 3020-7332
> skype: fbarrocal
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>


I would save User first, then People/Contact, as you need to get the
user_id for People.

 (shouldn't that be Person?)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How strict is your approach towards convention over configuration?

2010-11-03 Thread nurvzy
That's really clever AD. I was going to say you can edit all custom
foreign keys in the models and joins and cakephp will play nice, but
creating database views is a pretty slick approach I hadn't thought
of.

Nick

On Nov 3, 8:39 am, AD7six  wrote:
> On Nov 3, 9:32 am, Enno Weichert  wrote:
>
> > Hi,
>
> > I have to integrate a very bad legacy database where field names are
> > named inconsistently (like contact, Kontakt, contactID, contact_id,
> > KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
> > one table).
> > I would have to reflect all that in the models so I'd not have to use
> > that crap anymore.
> > So: how many of the fied references in your code are hard-coded? What
> > obstacles will I see? How much can I configure and still play cakephp?
>
> > Thanks,
> > Enno
>
> why don't you just create a view (assuming you can't edit the actual
> tables).
>
> I.e. CREATE OR REPLACE· v_tablename AS as SELECT  funky AS id, ext AS
> group_id  FROM optionalotherdatabase.tablename
>
> and use that instead of the real table. If you create simple views (no
> joins, basically) you can also update them.
>
> AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How strict is your approach towards convention over configuration?

2010-11-03 Thread Enno Weichert
You so I get this right:

1. I would need models for the "real" tables,
2. I would then need views for those,
3. Then I'd need other models for those views

4. And that's where we'd really start?

I'm asking this because the old codebase (we'll _not_ use) is already
complicated and bloated, the database is basically a pile of crap and
designing a "strange" workaround would probably do _my_ job but would
not improve anything for the future where somebody (most certainly
without a clue about all these models -- who reads docs...) will mess
it all up again.

I was hoping so much for a slick and transparent way to do this.

However this turn out I appreciate your effort answering, thank you :-D
Enno

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie trying to pass xml object

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 2:11 AM, sipiatti  wrote:
> did you debugged $modules?
> the message says it is not an object so does not have methods.
> something wrong there...

Yes, the HTTP protocol doesn't allow for passing class objects over the wire.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: repeated URL

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 12:23 AM, matsakaw  wrote:
>
> $this->Auth->loginRedirect = array('controller' => 'home');

The plot thickens. What's this controller for? And why do you not
specify an action? Do you have any routes set up for it?


> //TODO :        // $this->Auth->allow('display', 'index', 'view');
> //TODO :        find out its difference from $this->Auth->allowedActions =
> array('display', 'index', 'view');

The first is a class method to set the class variable (the second, above).

http://api.cakephp.org/class/auth-component


>        function beforeRender() {
> //TODO :        understand the difference of 'Auth' or 'auth'
> //??            i forgot which tutorial this line came from
> //??            does this mean i have both $Auth and $auth variables? (see
> beforeFilter)
>                $this->set('auth', $this->Auth->user());
>        }

$auth, in this case, is simply a variable set for the view and isn't
"built in". It looks like whoever wrote the tutorial wanted to have
access to the User info while in the view. But that can be done with:

$this->Session->read('Auth.User.x');

(where x is the User field you're after)

FYI, it'd be better to remove your comments from posted code, unless
it's pertinent to the problem, as it makes things very difficult to
read.


> 3. answers to your questions, and (sorry...) some more clarifications
>
>> If you can edit your httpd.conf or virtual host configs, the best
>> thing to do is to set DocumentRoot to:
>>
>> /var/www/web2/web/app/webroot
>
> If i do as you suggested, should i change config.php and the defines
> in the 3 index.phps?

Right. I'd forgotten to cover that. You can leave the top 2 index.php
files as they are. If things are working correctly, they'll never be
read. The one in app/webroot looks correct.

I don't know which config.php you're referring to, sorry.


>>  Is this a shared hosting
>> environment?
> Yes, they are using ISPConfig.
>
>> I'm wondering if there's something else configured that's
>> hidden from you.
> I was also suspecting that.  Maybe ISPConfig's has RewriteBase that is
> wrong? I can ask web host.

That might be it.


> 4. Maraming salamat (thank you in Filipino (from the Philippines) )
> for sharing your experience and time.

Hey, thanks for that. I'm always happy to learn a few words in another
language. "Thank you" is usually the first thing I'd like to know.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Standard mechanism for telling why a record hasn't been deleted?

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 4:27 AM, AD7six  wrote:
>
> On the plus side, at least you used validation errors which is
> contextually more relevant than creating a new variable for storing
> your delete-only errors IMO.

Agreed. Although I don't like the approach, using $validationErrors
was a nice touch.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Value from select to controller

2010-11-03 Thread cricket
On Wed, Nov 3, 2010 at 7:10 AM, Antar  wrote:
>
> Am not sure what I did but this is working now. The wonders of
> cakephp ;-)


Been there :-)

FYI, you can cut out a few lines of code by doing:

$this->set(
'depotlist',
$this->Depot->find('list')
);

http://book.cakephp.org/view/1022/find-list

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Can i send email through mysql/cakephp when the users are offline?

2010-11-03 Thread Miles J
No there isn't such functionality.

Furthermore, how are you detecting an "offline" user?

On Nov 2, 9:03 pm, Jerin K Alexander 
wrote:
> My objective is to send a mail when the users are offline. It depends
> on a particular row or value inserted in the table. if such an option
> provide by cake or mysql,please help me..

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: blackHole($controller, $string) leads to "Missing argument 2 for AppController::blackHole()" *+

2010-11-03 Thread nurvzy
What AD is saying is the security component is setting $error to an
empty string (in the method header) if it doesn't exist, you are not.
As such when the second argument isn't given in *your* method, instead
of $error being set to '' you'll get a notification.

Hope that helps,
Nick

On Nov 3, 4:59 am, AD7six  wrote:
> On Nov 3, 11:56 am, AD7six  wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 3, 10:44 am, psybear83  wrote:
>
> > > Hey guys
>
> > > I've implemented a blackhole in my AppController:
>
> > > function blackHole($controller, $error) {
> > >   trigger_error(__('You have been black holed because something went
> > > horribly wrong!', true), E_USER_WARNING);
> > >   die;
>
> > > }
>
> > > Sadly I'm getting a "Missing argument 2 for
> > > AppController::blackHole()" when the blackHole is called, but
> > > according to this document my method signature should be valid?!
>
> > Does your method signature match that of the method you're overriding
>
> correction: Does your method signature match that of the method the
> security component is expecting you to create ;).
>
> http://api.cakephp.org/view_source/security-component/#l-436
>
> AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


RE: Anyone care to help with Media Temple dv?

2010-11-03 Thread Dave Maharaj
Hey thanks.

Ok htaccess is there and site is up but cache not writable is next
errorsplenty of those.

Did some reading and to me it looked like I had np option but to put "cake"
folder in httpdocs?Weird no? I was on their (gs) server and was able to move
my folder outside of the root folder but on a higher end server more $$$ I
have to keep it in root folder?

Im no server giuy so please bare with me...any and all tips / advice will be
greatly appreciated.
Thanks,

Dave

-Original Message-
From: td-nathan [mailto:tyler.digi...@gmail.com] 
Sent: November-03-10 4:12 AM
To: CakePHP
Subject: Re: Anyone care to help with Media Temple dv?

Try the .htaccess first, next I'd look at php.ini settings like
safemode or basedir restrictions depending on where you placed the
cake install relative to httpdocs

-Nathan

On Nov 2, 7:25 pm, "Dave Maharaj"  wrote:
> I had my site on Media Temple gs service no problem. Now moving it to dv
and
> I got nothing. Uploaded everything but no htaccess file appears so I think
> that might be part of the problem. Get no error message other than 500
> server error.
>
> Any ideas / help would be great as I cant seem to find anything.
>
> Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


integrating - swfUpload or Uploadify doesn't work

2010-11-03 Thread lordojazz
Hello I'm having a hard time implementing swf upload on my app, I'm
using SWFUpload v2.2.0.1 and CakePHP 1.3.4 but it seems like the it
doesn't call my controller action where the ftp upload functionality
is...

I have tried creating swfupload Component as well it is just simple
ftp upload... without the swfupload or uploadify the component works
properly.

can any one help me with this issue please.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Auto-fill Date Values In Form

2010-11-03 Thread Adam
I'm having trouble auto-filling the form input with the date value
that's already been saved in the database.

Simply, I've saved a selected date, but when I return to edit it, the
date defaults to today's date.
I've never had a problem with the auto-filling forms before, but for
some reason this won't work.

Does anyone have any suggestions how to extract the D, M & Y values
out of a date string using Cake i.e. $job['Job']['date']['month']
etc.? I was thinking I could make my own separate inputs for each day,
month and year...

Thanks,

Adam

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How strict is your approach towards convention over configuration?

2010-11-03 Thread AD7six


On Nov 3, 9:32 am, Enno Weichert  wrote:
> Hi,
>
> I have to integrate a very bad legacy database where field names are
> named inconsistently (like contact, Kontakt, contactID, contact_id,
> KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
> one table).
> I would have to reflect all that in the models so I'd not have to use
> that crap anymore.
> So: how many of the fied references in your code are hard-coded? What
> obstacles will I see? How much can I configure and still play cakephp?
>
> Thanks,
> Enno

why don't you just create a view (assuming you can't edit the actual
tables).

I.e. CREATE OR REPLACE· v_tablename AS as SELECT  funky AS id, ext AS
group_id  FROM optionalotherdatabase.tablename

and use that instead of the real table. If you create simple views (no
joins, basically) you can also update them.

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How do I map legacy _field_ names to better suited (read Cake-like) ones?

2010-11-03 Thread Enno Weichert
As mentioned in my previous post I have a pretty ugly legacy database
to work with.
Examples: contact_id is contact, contactid, kontakt, kontaktid etc.
In one table "ext" is actually the group_id field...

I want to map these field names so I won't have to use them anymore in
the application except for the model.
The problem is I cannot use views on the database (mysql) side so I'll
have to do this in the model.

However, I cannot wrap my mind around the thing.
$_schema seems to get overwritten by whatever is in the table and I
cannot see which callback would work so I can do this properly in the
model.

I cannot believe I'm the first one encountering this problem but I
couldn't find anything on the web :-/

Mind you: this isn't about table names, foreign keys or primary keys
that part was pretty straight forward and worked out pretty well!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Problem while saving

2010-11-03 Thread XyXEL
Hey guys,

i am new to cakephp and fail at saving data. I got a model Profile
which contains many user-profile information. In one action i want to
rate the profile using ajax and save the rating to the database:
(unrelated stuff commented)

function rate($id = null, $points=null) {
//Configure::write('debug', 0);
//$this->autoRender = false;
//$this->disableCache();
//$this->RequestHandler->setContent('json', 'text/x-json');
//if ($this->RequestHandler->isAjax()) {
//if ( $this->Profile->exists($id) && preg_match('#^[0-9]+
$#',$points) && (int)$points >=1 && (int)$points <= 10 ) {
//$canVote = $this->Profile->Rating->canVote($id);
//if ($canVote) {
$profile = $this->Profile->read(null, $id);

$saveData = array('Profile' => array());
$saveData['Profile']['rating'] =
$profile['Profile']['rating'] + $points;
$saveData['Profile']['raters'] =
$profile['Profile']['raters'] + 1;
$saveData['Profile']['avgrating'] =
$saveData['Profile']['rating']/$saveData['Profile']['raters'];

var_dump($this->Profile->save($saveData));

//$this->Profile->Rating->create();
//$this->Profile->Rating->set('ip',
$_SERVER['REMOTE_ADDR']);
//$this->Profile->Rating->set('profile_id', $id);
//$this->Profile->Rating->save();

$jsonData = $saveData['Profile'];

echo json_encode($jsonData);
exit(0);
//}
//}
//}
//echo '0';
//exit(0);
}

Well if i call this page in browser, the output is:

bool(false) {"rating":20,"raters":4,"avgrating":5}

Obviously the saving failed, but why?
The Profile model has no validation rules for the fields used here,
however it has rules for other fields...

If i use something like this:
 $this->Profile->saveField('raters', $this->Profile->field('raters') +
1 );
it works but causes too many mysql querys :(

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How strict is your approach towards convention over configuration?

2010-11-03 Thread Enno Weichert
Hi,

I have to integrate a very bad legacy database where field names are
named inconsistently (like contact, Kontakt, contactID, contact_id,
KontaktID etc.) or even randomly ("ext" is in fact a group_id field in
one table).
I would have to reflect all that in the models so I'd not have to use
that crap anymore.
So: how many of the fied references in your code are hard-coded? What
obstacles will I see? How much can I configure and still play cakephp?

Thanks,
Enno

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: find all with at least one associated model

2010-11-03 Thread Max D
Thanks,

I'm now using the counter cache.
I tried the INNER join version as well and I got good looking result
arrays, but it seems using GROUP BY in pagination messes pagination
up.
$this->paginate = array(
'Blog' => array(
'joins' => array(
array(
'table' => 'posts',
'alias' => 'Post',
'type' => 'INNER',
'conditions' => array(
'Blog.id = Post.blog_id',
),
)
),
'group' => 'Blog.id',
)
);

$this->Paginator->counter always returned 1.

Anyway, having the counter_cache is nice anyway. So my problem is
solved.

On Nov 2, 9:12 am, ohcibi  wrote:
>  The easiest way would be to Use countercache and then just add
> post_count > 0 to conditions... if you cant zdf countercache for some
> reason you could also inner join the posts Table, which would leave
> all blogs that have no assocciated post...
> On 1 Nov., 18:29, Max D  wrote:
>
> > Hi,
>
> > i use cake 1.3 and I have a "Blog hasMany Post" association and now I
> > want to find all the Blogs, which have at least one Post. I use the
> > Containable Behavior.
>
> > I understand, that I could do a Blog->find('all', array('contain' =>
> > array('Post'))) and simply filter the results for the Blogs, where the
> > Post array is empty.
> > But this doesn't work if I want to use pagination.
>
> > I tried to paginate over the Post model:
> > $this->paginate = array('Post' => array(
> >         'contain' => array('Blog'),
> >         'order' => 'Blog.created DESC',
> >         'group' => 'Post.blog_id',
> >         'limit' => 5,
> > ));
> > $blog = $this->paginate('Post');
>
> > The Blog array looks good. I just get the Blogs with one Post each
> > (which I don't actually need). But all the PaginatorHelper functions
> > return wrong results.
> > $this->Paginator->counter(array('model' => 'Post'));
> > always returns 1, although there are 3 results in the $blogs array.
>
> > Any ideas how I can achieve this?
> > Thanks in advance
> > Max

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: empty respose after formular was sent

2010-11-03 Thread Almudena Garcia
Could you please write some of your code for your form?
That will help to know where your problem can be.

Regards.

2010/11/2 rethab 

> I sorry for my one man conversation, but I hope this is gonna be my
> last post and will probably help you.
>
> I noticed some similar behavior like this bug:
> https://trac.cakephp.org/ticket/5489
> Actually, the bug described there happens when submitting a file,
> which I did not do. But as for the similarities: I managed to get the
> form working after I had disabled the Security component. Secondly, as
> I went through the apache logs, I discovered the 404 errors unlike my
> web browser which showed code: 200.
>
> My form did not only contain data for the model Student but also some
> other things which were related to it.
> works:
> - security enabled, form with student data only
> - security disabled, form with all data
>
> When submitting additional data in combination with an activated
> security component, it failed. As for cake, I'm really not a pro, but
> I suppose there might be an issue in the generation of _Token (key,
> fields) in combination with additional (more than just the ordinary
> model) form data.
>
> Regards,
> rethab
>
> On Nov 2, 9:46 pm, rethab  wrote:
> > Edit:
> > When I submit the form, I get an empty page, but with status code 200.
> > Further, I added debug messages to beforeFilter, afterFilter and
> > beforeRender of which only the beforeFilter debbug-msg appeared in the
> > output.
> >
> > Regards,
> > rethab
> >
> > On Nov 2, 9:43 pm, rethab  wrote:
> >
> > > Hello
> >
> > > I have a form for my model 'Student'. So I have this page with the url
> > > 'students/add' to add new ones. It all works unless I submit the form.
> > > I checked the params via $this->params in beforeRender and the URL
> > > seemed to be the same when I submitted the form as well as when just
> > > displaying the form.
> >
> > > So I debugged in the Security Component inside the method 'blackHole',
> > > the parameter $error is 'auth' at this point. Therefore I set up all
> > > the Auth stuff once again, but it had no affect.
> >
> > > I once worked.. but I have no clue, at which point it "died".
> >
> > > I'd appreciate it if anybody could give me a hint..
> >
> > > Regards,
> > > rethab
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Value from select to controller

2010-11-03 Thread Antar


On Nov 3, 9:38 am, Antar  wrote:
> On Nov 3, 12:25 am, cricket  wrote:
>
> > On Tue, Nov 2, 2010 at 10:23 AM, Antar  wrote:
> > > Hi
>
> > > May seem very basic but I have a login form that expects a username &
> > > password and a location. The location is chosen from a select and I
> > > want to write the selected location to the session data for the user.
> > > I need in passing the chosen location id from the form to the
> > > controller.
>
> > Get it from $this->data.
>
> I am trying that but I can't get any values. I have the following in
> the form (The select lists the locations ('depot') as it should do)
>
> Login
>  echo $session->flash('auth');
> echo $this->Form->create('User', array('url' => array('controller' =>
> 'users', 'action' =>'login')));
> echo $this->Form->input('User.username');
> echo $this->Form->input('User.password');
> echo $form->input('depot', array('options' =>
> array($depotlist),'selected' => $this->data['User']['depot'],'label'
> => 'Depot'));
>
> I have the following in the user_controller.php
>
> function login()
>                         {
>
>                         $data_array = $this->Depot->find('all',array('fields' 
> =>
> array('Depot.id', 'Depot.name')));  //For all of the records in the
> table
>                         $data_combine = Set::combine($data_array,
> '{n}.Depot.id','{n}.Depot.name');
>                         $this->set('depotlist',$data_combine);
>                         if ($this->Auth->user())
>                                 {
>                                 print_r($this->data['User']['depot']);
>                                 $this->Session->write('depot', 
> $this->data['User']
> ['depot']);      // this is the 'real write' that doesn't work
>                                 // $this->Session->write('depottest', 
> 'testdepot');                       // this
> write is for test only & works
>                                 $this->redirect($this->Auth->redirect());
>
>                                 }
>
>                         }
>
> I assume, because the test write does work, that $this->data is never
> populated

Am not sure what I did but this is working now. The wonders of
cakephp ;-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: blackHole($controller, $string) leads to "Missing argument 2 for AppController::blackHole()" *+

2010-11-03 Thread AD7six


On Nov 3, 11:56 am, AD7six  wrote:
> On Nov 3, 10:44 am, psybear83  wrote:
>
> > Hey guys
>
> > I've implemented a blackhole in my AppController:
>
> > function blackHole($controller, $error) {
> >   trigger_error(__('You have been black holed because something went
> > horribly wrong!', true), E_USER_WARNING);
> >   die;
>
> > }
>
> > Sadly I'm getting a "Missing argument 2 for
> > AppController::blackHole()" when the blackHole is called, but
> > according to this document my method signature should be valid?!
>
> Does your method signature match that of the method you're overriding

correction: Does your method signature match that of the method the
security component is expecting you to create ;).

http://api.cakephp.org/view_source/security-component/#l-436

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: blackHole($controller, $string) leads to "Missing argument 2 for AppController::blackHole()" *+

2010-11-03 Thread AD7six


On Nov 3, 10:44 am, psybear83  wrote:
> Hey guys
>
> I've implemented a blackhole in my AppController:
>
> function blackHole($controller, $error) {
>   trigger_error(__('You have been black holed because something went
> horribly wrong!', true), E_USER_WARNING);
>   die;
>
> }
>
> Sadly I'm getting a "Missing argument 2 for
> AppController::blackHole()" when the blackHole is called, but
> according to this document my method signature should be valid?!

Does your method signature match that of the method you're overriding

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


blackHole($controller, $string) leads to "Missing argument 2 for AppController::blackHole()" *+

2010-11-03 Thread psybear83
Hey guys

I've implemented a blackhole in my AppController:

function blackHole($controller, $error) {
  trigger_error(__('You have been black holed because something went
horribly wrong!', true), E_USER_WARNING);
  die;
}

Sadly I'm getting a "Missing argument 2 for
AppController::blackHole()" when the blackHole is called, but
according to this document my method signature should be valid?!

http://book.cakephp.org/view/1307/blackHole-object-controller-string-error

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Value from select to controller

2010-11-03 Thread Antar


On Nov 3, 12:25 am, cricket  wrote:
> On Tue, Nov 2, 2010 at 10:23 AM, Antar  wrote:
> > Hi
>
> > May seem very basic but I have a login form that expects a username &
> > password and a location. The location is chosen from a select and I
> > want to write the selected location to the session data for the user.
> > I need in passing the chosen location id from the form to the
> > controller.
>
> Get it from $this->data.

I am trying that but I can't get any values. I have the following in
the form (The select lists the locations ('depot') as it should do)


Login
flash('auth');
echo $this->Form->create('User', array('url' => array('controller' =>
'users', 'action' =>'login')));
echo $this->Form->input('User.username');
echo $this->Form->input('User.password');
echo $form->input('depot', array('options' =>
array($depotlist),'selected' => $this->data['User']['depot'],'label'
=> 'Depot'));

I have the following in the user_controller.php

function login()
{

$data_array = $this->Depot->find('all',array('fields' =>
array('Depot.id', 'Depot.name')));  //For all of the records in the
table
$data_combine = Set::combine($data_array,
'{n}.Depot.id','{n}.Depot.name');
$this->set('depotlist',$data_combine);
if ($this->Auth->user())
{
print_r($this->data['User']['depot']);
$this->Session->write('depot', 
$this->data['User']
['depot']);  // this is the 'real write' that doesn't work
// $this->Session->write('depottest', 
'testdepot'); // this
write is for test only & works
$this->redirect($this->Auth->redirect());

}

}

I assume, because the test write does work, that $this->data is never
populated

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Display a 404 when a record isn't found and redirect?

2010-11-03 Thread psybear83
Hi everybody

I'm currently making sure that invalid IDs in URLs are catched and the
user is informed about the invalid ID. So far I just set a flash
message and redirected to the index, but now I'm wondering whether I
should also send a 404 header in addition to this?

Thanks
Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Error on test.php page, missing arguments.php on Simple Test

2010-11-03 Thread kadanis
Hi huoxito

Yes, I've read that post too.  PhpUnit is becoming the defacto test
suite it seems, and it makes sense for Cake to make the switch.  But
as Mark points out, this wont be until version 2.0 which is a way off
in the future.  For now SimpleTest should be fine, and as long as you
try to stick to the Cake conventions for testing, we can hope the
migration path is as painless as possible.

Remember, the Cake test suite wraps SimpleTest, so as long as they can
wrap PhpUnit the same way and expose the same feature set. your
current tests should continue to work.

I think one or two of the comments on the post relate to this very
topic.

Glad you are both up and running now.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Standard mechanism for telling why a record hasn't been deleted?

2010-11-03 Thread AD7six


On Nov 3, 9:02 am, alaxos  wrote:
> Yes, but the point for me is that this solution needs really less
> code. Once you have modified the AppModel and the layout, it works for
> every controller and every action, without adding code in controllers.

and you can't turn it off.

Btw there's an onError callback which is in part for handling this
sort of thing.

>
> But it is a matter of choice... :-)

If you want something like that where's the hardship in using your app
controller beforeRender to look for the errors and set flash messages
appropriately or whatever display logic you choose. Mixing MVC to save
a line of code isn't going to save you anything the first time
someone, probably someone else,  looks at your code and  can't see
where or how these db errors they want to hide/modify/whatever are
coming from.

On the plus side, at least you used validation errors which is
contextually more relevant than creating a new variable for storing
your delete-only errors IMO.

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Standard mechanism for telling why a record hasn't been deleted?

2010-11-03 Thread alaxos
Yes, but the point for me is that this solution needs really less
code. Once you have modified the AppModel and the layout, it works for
every controller and every action, without adding code in controllers.

But it is a matter of choice... :-)


On Nov 3, 2:24 am, cricket  wrote:
> On Tue, Nov 2, 2010 at 6:31 PM, alaxos  wrote:
> > Hi,
>
> > Personally for these kinds of errors, I prefer to rely on the errors
> > raised by the database.
>
> > However, AFAIK, CakePHP does not return these errors automatically. I
> > found a solution, but it uses a very discussed technique: accessing
> > the Session in the model layer. It could also use a model variable
> > instead, that would be then read in the controller actions, but this
> > would mean updating a lot of them...
>
> Or you could just let the controller get the error from the model and
> set it for the view. Far less complicated.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en