Re: isAjax() - how do I use?

2007-04-18 Thread Felix Geisendörfer
>
> I haven't experienced it personally. But, IIRC, someone in c.l.php
> informed that Norton Firewall on IE will trim the extra headers for
> privacy thing.
That is called crippling your communication not privacy or security. I 
hope this only happens through an optional setting and not on a 
default-basis. I mean if we cannot assume that client requests are 
correct, how can we know what to return at all? Personally I'll take the 
route of sticking to standards and not waste my time on IEs that are 
crippled beyond what Microsoft has done to us ; ).

-- Felix
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


R. Rajesh Jeba Anbiah wrote:
> On Apr 18, 6:30 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>   
>>>   FWIW, I personally feel isAjax is quite unreliable (when under
>>> Firewall) as it depends on HTTP_X_REQUESTED_WITH header. bare/ajax
>>> would be ideal, IMHO.
>>>   
>> Hm? What Firewalls are filtering out HTTP headers? Is that some sort of
>> "anonymous" feature? If you ask me this sounds really bad and hopefully
>> is not popular enough to make it worth to put any effort into a work-around!
>> 
> 
>
> I haven't experienced it personally. But, IIRC, someone in c.l.php
> informed that Norton Firewall on IE will trim the extra headers for
> privacy thing.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
>
>
> >
>
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: isAjax() - how do I use?

2007-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 18, 6:30 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
> >   FWIW, I personally feel isAjax is quite unreliable (when under
> > Firewall) as it depends on HTTP_X_REQUESTED_WITH header. bare/ajax
> > would be ideal, IMHO.
>
> Hm? What Firewalls are filtering out HTTP headers? Is that some sort of
> "anonymous" feature? If you ask me this sounds really bad and hopefully
> is not popular enough to make it worth to put any effort into a work-around!


I haven't experienced it personally. But, IIRC, someone in c.l.php
informed that Norton Firewall on IE will trim the extra headers for
privacy thing.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread Dr. Tarique Sani

On 4/19/07, rtconner <[EMAIL PROTECTED]> wrote:
>
> Hello, (in 1.2) does anyone know what the intended behavior of
> alowEmpty should be in the validate array in a model?
>
> You would think it would set the behavior to allow you to submit an
> empty string that passes validation. For example, you may either pass
> a valid phone number, or not send one at all. This was 'asdasda' does
> not count as a phone number, but the phone number is not a required
> field also.

Use custom regex which matches blank|pattern typically the regex will start as
^[  ]*$|

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Unbinding Behaviors

2007-04-18 Thread gwoo

how about changing $this->Model->actsAs?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread Dr. Tarique Sani

On 4/19/07, eKiTeL <[EMAIL PROTECTED]> wrote:
>
> they're at the top of the list of saved pastes:
>

In your view use

tagErrorMsg('Item/Filedata', 'Image required.') ?>

And in the controller

} else {
 $this->Item->invalidate('Filedata');
 $this->Session->setFlash($this->SwfUpload->errorMessage);
}

Hint: take the hints when they given :)

HTH
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread Dr. Tarique Sani

On 4/18/07, GreyCells <[EMAIL PROTECTED]> wrote:
>
> Golden Rule #243: Never let the client touch your code. If they don't
> understand why it's 'complicated' they are going to break something.
> Then they get to keep both parts.
>

He he he! thats what hourly rates are for ;)

On a more serious note - since we are usually developers for
developers we ask the client before hand as to their IT people's
expertise in PHP and then gauge how much they are willing to learn.
Luckily almost of all them are very eager to learn once the benefits
are explained.

Problem arises when there are two or more independent teams and the
other team has  (in their perception) had parts of their work taken
away from them OR for that matter have, ummm... strong political views
about globalization.

If we perceive this right at the beginning we do not take the project,
if this crops up later we adjust

The bottom line being, "this is complex" is generally not a technical thing.

Cheers
Tarique

-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Getting Different Sessions for HTTPS and HTTP

2007-04-18 Thread [EMAIL PROTECTED]

I found the problem - some of my redirects ended up at
domainname.com.au instead of WWW.domainname.com.au - so I ended up
with one session for www.dmainname.com.au and another one for
domainname.com.au



On Apr 19, 11:50 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I have a site where some sections are accessed via HTTPS ( login,
> payments ) while the rest is accesses via HTTP. Currently I have a
> problem where I get a different session data for each protocol.
>
> On my windows development environment everything works fine - when
> using either HTTPS or HTTP cake retrieves and stores the same session
> record from the cake_sessions table.
> However on the production system (linux) I get two session records
> created in the cake_sessions table - one for HTTP and one for HTTPS.
>
> I have updated to the latest cake_1.1.12.1797 and the result is the
> same
>
> Can someone suggest what may be the issue here and how to get just one
> session for both HTTPS and HTTP protocols.
>
> Thanks, Ian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Getting Different Sessions for HTTPS and HTTP

2007-04-18 Thread [EMAIL PROTECTED]

I have a site where some sections are accessed via HTTPS ( login,
payments ) while the rest is accesses via HTTP. Currently I have a
problem where I get a different session data for each protocol.

On my windows development environment everything works fine - when
using either HTTPS or HTTP cake retrieves and stores the same session
record from the cake_sessions table.
However on the production system (linux) I get two session records
created in the cake_sessions table - one for HTTP and one for HTTPS.

I have updated to the latest cake_1.1.12.1797 and the result is the
same

Can someone suggest what may be the issue here and how to get just one
session for both HTTPS and HTTP protocols.

Thanks, Ian


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session question.

2007-04-18 Thread schogini


Hi,

What you need to do is to add/use the helper

$session->check('function')

Regards Sree



peterhf wrote:
> 
> 
> I have created a thtml file and placed it in the /pages/ directory. In
> the file I have "if ($this->Session->check('function')) ...". The
> following error message appears: "Fatal error: Call to a member
> function on a non-object in ..." which points to the line containing
> the "...Session->check".
> 
> I thought that the Session Component was available to every Cake
> controller including the PagesController.
> 
> Where have I gone wrong?
> 
> Peter -
> 
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Session-question.-tf3578074.html#a10033925
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: composed primary key

2007-04-18 Thread Mariano Iglesias

Oh crap, it was just me. Sorry for the spam :)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Mariano Iglesias
Enviado el: Miércoles, 18 de Abril de 2007 08:59 p.m.
Para: cake-php@googlegroups.com
Asunto: RE: composed primary key

Ok, got this message more than 5 times already... Someone got their email
program screwed up? ;)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: composed primary key

2007-04-18 Thread Mariano Iglesias

Ok, got this message more than 5 times already... Someone got their email
program screwed up? ;)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Joshua Benner
Enviado el: Miércoles, 18 de Abril de 2007 08:31 p.m.
Para: Cake PHP
Asunto: Re: composed primary key

I was recently working with creating a web-based interface to a small
part of vendor-supplied database application. 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Unbinding Behaviors

2007-04-18 Thread cperler

Hello,

Might anyone know of a way to unbind a behavior from a model?

Thank you,

Craig


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: composed primary key

2007-04-18 Thread Joshua Benner

I was recently working with creating a web-based interface to a small
part of vendor-supplied database application. Most of the HUNDREDS of
tables have two or more keys. Since the application was going to be
read only, I wrapped the tables I was using into views (many times
simplifying or compiling the data), and for every table that had
compound keys, I had an 'ID' field in the view that had the value of
each of the keys separated by '|' -- it's arguably an ugly solution,
but it proved speedy, made the table data very readable, provided a
consistent means for IDing records (and foreign keys), and best of all
-- was quick, easy, and required very little coding.

Your mileage may vary, of course.

On Apr 18, 3:11 pm, GreyCells <[EMAIL PROTECTED]> wrote:
> That's far too pragmatic Nate :)
>
> How am I going to earn my fee if you keep coming up with such easy
> solutions? Oh wait a minute - I'm not being paid for this one...
>
> On Apr 18, 8:04 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > Actually, I thought of one possible solution for that: move all the
> > records to another (temp) table, truncate the table, and add the pre-
> > existing records back.  That would reset the ID.
>
> > GreyCells wrote:
> > > I think you mean compund primary key. See:
>
> > >http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8...
>
> > > Especially Nate's comments. Coincidentally, I had a requirement for
> > > one today - but only because mysql can't recycle sequences...
>
> > > ~GreyCells
>
> > > On Apr 18, 6:14 pm, "John David Anderson (_psychic_)"
> > > <[EMAIL PROTECTED]> wrote:
> > > > On Apr 18, 2007, at 10:08 AM, christianandradet wrote:
>
> > > > > I don't know what to do, how do i define the composed primary key???
>
> > > > Why do you need one? Is 'id' not unique?
>
> > > > -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread nate

As of 1.2 current SVN:

function beforeValidate() {
   $this->data[$this->name] = Set::filter($this->data[$this->name],
true);
   return true;
}

Works for me.

On Apr 18, 5:18 pm, rtconner <[EMAIL PROTECTED]> wrote:
> Wow did you pick an ambiguous name for that then. Holy misleading
> batman.
>
> So how the heck do I do what I want to do? I can't help but think
> enhancement/bug # 2092 is a "must have". I can't even think of a
> workaround at the moment.
>
> On Apr 18, 3:05 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > It technically means "allowNotPresent" as in "not present in the array
> > of data to be saved", but I felt that was too cumbersome.
>
> > rtconner wrote:
> > > Hello, (in 1.2) does anyone know what the intended behavior of
> > > alowEmpty should be in the validate array in a model?
>
> > > You would think it would set the behavior to allow you to submit an
> > > empty string that passes validation. For example, you may either pass
> > > a valid phone number, or not send one at all. This was 'asdasda' does
> > > not count as a phone number, but the phone number is not a required
> > > field also.
>
> > > ..but this is not the behavior I am seeing. As far as I can tell
> > > allowEmpty does nothing to change the behavior. Actually I looked at
> > > the code in model and yes the code does not implement this behavior
> > > either. I'm trying to determine if this is a bug or not.
>
> > > So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread rtconner

Good call GreyCells. Thanks.

I dont care if DB has NULL or an empty string. So that will work in
this situation.
Still would like to see bug 2092 implemented though.

On Apr 18, 3:43 pm, GreyCells <[EMAIL PROTECTED]> wrote:
> A possible workaround is to unset any empty fields in
> beforeValidates() - validate will then ignore them if allowBlank is
> set.
>
> However, there is a conflict if you're also using beforeValidates() to
> set blank fields to null (so they are null rather than an empty string
> in the database) - depends if you're a pedantic db developer or not :)
>
> ~GreyCells.
>
> On Apr 18, 10:18 pm, rtconner <[EMAIL PROTECTED]> wrote:
>
> > Wow did you pick an ambiguous name for that then. Holy misleading
> > batman.
>
> > So how the heck do I do what I want to do? I can't help but think
> > enhancement/bug # 2092 is a "must have". I can't even think of a
> > workaround at the moment.
>
> > On Apr 18, 3:05 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > > It technically means "allowNotPresent" as in "not present in the array
> > > of data to be saved", but I felt that was too cumbersome.
>
> > > rtconner wrote:
> > > > Hello, (in 1.2) does anyone know what the intended behavior of
> > > > alowEmpty should be in the validate array in a model?
>
> > > > You would think it would set the behavior to allow you to submit an
> > > > empty string that passes validation. For example, you may either pass
> > > > a valid phone number, or not send one at all. This was 'asdasda' does
> > > > not count as a phone number, but the phone number is not a required
> > > > field also.
>
> > > > ..but this is not the behavior I am seeing. As far as I can tell
> > > > allowEmpty does nothing to change the behavior. Actually I looked at
> > > > the code in model and yes the code does not implement this behavior
> > > > either. I'm trying to determine if this is a bug or not.
>
> > > > So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread GreyCells

A possible workaround is to unset any empty fields in
beforeValidates() - validate will then ignore them if allowBlank is
set.

However, there is a conflict if you're also using beforeValidates() to
set blank fields to null (so they are null rather than an empty string
in the database) - depends if you're a pedantic db developer or not :)

~GreyCells.


On Apr 18, 10:18 pm, rtconner <[EMAIL PROTECTED]> wrote:
> Wow did you pick an ambiguous name for that then. Holy misleading
> batman.
>
> So how the heck do I do what I want to do? I can't help but think
> enhancement/bug # 2092 is a "must have". I can't even think of a
> workaround at the moment.
>
> On Apr 18, 3:05 pm, nate <[EMAIL PROTECTED]> wrote:
>
> > It technically means "allowNotPresent" as in "not present in the array
> > of data to be saved", but I felt that was too cumbersome.
>
> > rtconner wrote:
> > > Hello, (in 1.2) does anyone know what the intended behavior of
> > > alowEmpty should be in the validate array in a model?
>
> > > You would think it would set the behavior to allow you to submit an
> > > empty string that passes validation. For example, you may either pass
> > > a valid phone number, or not send one at all. This was 'asdasda' does
> > > not count as a phone number, but the phone number is not a required
> > > field also.
>
> > > ..but this is not the behavior I am seeing. As far as I can tell
> > > allowEmpty does nothing to change the behavior. Actually I looked at
> > > the code in model and yes the code does not implement this behavior
> > > either. I'm trying to determine if this is a bug or not.
>
> > > So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread rtconner

Wow did you pick an ambiguous name for that then. Holy misleading
batman.

So how the heck do I do what I want to do? I can't help but think
enhancement/bug # 2092 is a "must have". I can't even think of a
workaround at the moment.



On Apr 18, 3:05 pm, nate <[EMAIL PROTECTED]> wrote:
> It technically means "allowNotPresent" as in "not present in the array
> of data to be saved", but I felt that was too cumbersome.
>
> rtconner wrote:
> > Hello, (in 1.2) does anyone know what the intended behavior of
> > alowEmpty should be in the validate array in a model?
>
> > You would think it would set the behavior to allow you to submit an
> > empty string that passes validation. For example, you may either pass
> > a valid phone number, or not send one at all. This was 'asdasda' does
> > not count as a phone number, but the phone number is not a required
> > field also.
>
> > ..but this is not the behavior I am seeing. As far as I can tell
> > allowEmpty does nothing to change the behavior. Actually I looked at
> > the code in model and yes the code does not implement this behavior
> > either. I'm trying to determine if this is a bug or not.
>
> > So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: allowEmpty in validate

2007-04-18 Thread nate

It technically means "allowNotPresent" as in "not present in the array
of data to be saved", but I felt that was too cumbersome.

rtconner wrote:
> Hello, (in 1.2) does anyone know what the intended behavior of
> alowEmpty should be in the validate array in a model?
>
> You would think it would set the behavior to allow you to submit an
> empty string that passes validation. For example, you may either pass
> a valid phone number, or not send one at all. This was 'asdasda' does
> not count as a phone number, but the phone number is not a required
> field also.
>
> ..but this is not the behavior I am seeing. As far as I can tell
> allowEmpty does nothing to change the behavior. Actually I looked at
> the code in model and yes the code does not implement this behavior
> either. I'm trying to determine if this is a bug or not.
>
> So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread eKiTeL

they're at the top of the list of saved pastes:

controller: http://bin.cakephp.org/saved/17969
view: http://bin.cakephp.org/saved/17968
model: http://bin.cakephp.org/saved/17967


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



allowEmpty in validate

2007-04-18 Thread rtconner

Hello, (in 1.2) does anyone know what the intended behavior of
alowEmpty should be in the validate array in a model?

You would think it would set the behavior to allow you to submit an
empty string that passes validation. For example, you may either pass
a valid phone number, or not send one at all. This was 'asdasda' does
not count as a phone number, but the phone number is not a required
field also.

..but this is not the behavior I am seeing. As far as I can tell
allowEmpty does nothing to change the behavior. Actually I looked at
the code in model and yes the code does not implement this behavior
either. I'm trying to determine if this is a bug or not.

So... how should allowEmpty cause things to behave?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread gwoo

Haha. thanks, Sam.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread thequietlab

sorry, I had it like this :
Router::connect ('/sitewatch/:action/
*',array('controller'=>'favorites'));

What I posted was just part of my desperate tests ;)

On 18 Kwi, 22:08, jitka <[EMAIL PROTECTED]> wrote:
> try
> Router::connect ('/sitewatch/:action/*',
> array('controller'=>'favorites'));


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread Samuel DeVore

if you want to keep gwoo from getting grumpy again, please post the
links to the pastes that you made in the bin.


On 4/18/07, eKiTeL <[EMAIL PROTECTED]> wrote:
>
> OK I just added code to CakeBin.  3 files: model, controller and
> view.  There is no code for validation in the controller but I
> included that anyway as per your request, the Title field validates
> the way I expect it to, it gives you a message if you leave it blank
> while the Image/Filedata field does not warn you if you don't select a
> file.
>
> On Apr 18, 4:01 pm, gwoo <[EMAIL PROTECTED]> wrote:
> > there is no code in your orgnial message that can be of any use to me
> > when providing help.http://bin.cakephp.org
> > add you controller and model there. then provide a link to the paste.
>
>
> >
>


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

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread eKiTeL

OK I just added code to CakeBin.  3 files: model, controller and
view.  There is no code for validation in the controller but I
included that anyway as per your request, the Title field validates
the way I expect it to, it gives you a message if you leave it blank
while the Image/Filedata field does not warn you if you don't select a
file.

On Apr 18, 4:01 pm, gwoo <[EMAIL PROTECTED]> wrote:
> there is no code in your orgnial message that can be of any use to me
> when providing help.http://bin.cakephp.org
> add you controller and model there. then provide a link to the paste.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread jitka

try
Router::connect ('/sitewatch/:action/*',
array('controller'=>'favorites'));


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread gwoo

there is no code in your orgnial message that can be of any use to me
when providing help.
http://bin.cakephp.org
add you controller and model there. then provide a link to the paste.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread eKiTeL

I have searched the group, what makes you think I haven't?  I don't
understand why you keep responding if you haven't read my original
post or my follow up both written in plain English.



On Apr 18, 3:20 pm, gwoo <[EMAIL PROTECTED]> wrote:
> So, in other words, you have not looked at the documentation or
> searched the google group as suggested. Personally, I find it very
> hard to help people that won't help themselves, newb or expert, does
> not make a difference to me. All I can do is suggest you paste some
> code because a picture speaks 1000 words.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Lumad CMS / (Cupcake)

2007-04-18 Thread [EMAIL PROTECTED]

Hello, Tarique.

It's a prohibition in CakeForge only, not elsewhere. My first
application got rejected so I used the word Lumad instead.

Regards.

On Apr 18, 12:23 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 4/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, this is Jason, author of CupCake CMS. (Lumad CMS is the project
> > name in CakeForge, renamed because of a policy that prohibits
> > unofficial projects to have the word cake in its name.)
>
> Ummm... use of cakephp in the name can be prohibited when did use of
> just 'cake' in projects become a NO NO?
>
> Cheers
> Tarique
>
> --
> =
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog needs you!:http://cheesecake-photoblog.org
> =


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Lumad CMS / (Cupcake)

2007-04-18 Thread [EMAIL PROTECTED]

Hello, Dan.

I assure you that CupCake CMS is easier to integrate with existing
sites than Drupal or Joomla. It never occurred to me, though, that
people will be using the CMS in this manner. Thanks to you and
keymaster, now I know. Perhaps I can design it to be a tool optimized
for integration with other Cake apps. Since I have no idea what your
apps look like, it would be best to let me know which parts of my code
take more effort to integrate.

Thanks again!

Jason


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread thequietlab

as for my custom route, it's just

Router::connect ('/sitewatch/*', array('controller'=>'favorites'));

I didn;t have the time to fight with it so I just make it work without
routes.. and I'm not yet into unit testing ;)

On 18 Kwi, 18:54, gwoo <[EMAIL PROTECTED]> wrote:
> oh, silly me forgot to mention that the router has full unit test
> coverage. So, how about one that proves your case.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Master view

2007-04-18 Thread Andreas

There is a part in the link i wrote which is describing something
about "default.thtml" in the layout folder. I tested doing that and it
worked as i wanted. But thanks for you link have been trying to find
that too :)

Yes, i read the section about leyouts :)

Thanks for the help!

On Apr 17, 7:22 pm, AD7six <[EMAIL PROTECTED]> wrote:
> I think it would be extremely valuable for you to read the view
> chapter in the manual, and look for the word "layout". This should
> have been step one of your quest for info.
>
> Unless there is something you haven't mentioned yet, using smarty or
> joomla layouts or anything else instead of just using cake pre
> existing layout mechanism seems a rather ineffective use of cake and
> your own time ;).
>
> hth,
>
> AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread gwoo

So, in other words, you have not looked at the documentation or
searched the google group as suggested. Personally, I find it very
hard to help people that won't help themselves, newb or expert, does
not make a difference to me. All I can do is suggest you paste some
code because a picture speaks 1000 words.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate with SwfUpload

2007-04-18 Thread eKiTeL

I don't think you read my original question, the validation methods I
learned in the manual don't work here, and why would I search for
'invalidate' when what I want to do is 'validate'?  I also mentioned
that I'm new to CakePHP, but you probably missed that part also

On Apr 15, 9:41 pm, "gwoo" <[EMAIL PROTECTED]> wrote:
> Have you seen the manual? I dont mean to bad mouth you, but have you
> searched for "invalidate"?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: composed primary key

2007-04-18 Thread GreyCells

That's far too pragmatic Nate :)

How am I going to earn my fee if you keep coming up with such easy
solutions? Oh wait a minute - I'm not being paid for this one...



On Apr 18, 8:04 pm, nate <[EMAIL PROTECTED]> wrote:
> Actually, I thought of one possible solution for that: move all the
> records to another (temp) table, truncate the table, and add the pre-
> existing records back.  That would reset the ID.
>
> GreyCells wrote:
> > I think you mean compund primary key. See:
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8...
>
> > Especially Nate's comments. Coincidentally, I had a requirement for
> > one today - but only because mysql can't recycle sequences...
>
> > ~GreyCells
>
> > On Apr 18, 6:14 pm, "John David Anderson (_psychic_)"
> > <[EMAIL PROTECTED]> wrote:
> > > On Apr 18, 2007, at 10:08 AM, christianandradet wrote:
>
> > > > I don't know what to do, how do i define the composed primary key???
>
> > > Why do you need one? Is 'id' not unique?
>
> > > -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: composed primary key

2007-04-18 Thread nate

Actually, I thought of one possible solution for that: move all the
records to another (temp) table, truncate the table, and add the pre-
existing records back.  That would reset the ID.

GreyCells wrote:
> I think you mean compund primary key. See:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8217435cc/255c641339eef6ac?lnk=gst&q=compound+primary+key&rnum=1#255c641339eef6ac
>
> Especially Nate's comments. Coincidentally, I had a requirement for
> one today - but only because mysql can't recycle sequences...
>
> ~GreyCells
>
> On Apr 18, 6:14 pm, "John David Anderson (_psychic_)"
> <[EMAIL PROTECTED]> wrote:
> > On Apr 18, 2007, at 10:08 AM, christianandradet wrote:
> >
> > > I don't know what to do, how do i define the composed primary key???
> >
> > Why do you need one? Is 'id' not unique?
> >
> > -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Scaffolding question

2007-04-18 Thread Sonic Baker
You can use the bake.php script for generate scaffolded Models, Views, and
Controllers. This generates actual code so you don't have to set the
$scaffold variable.
You can then remove the select box from the view code and edit the
controller to set the customer_id there.

Cheers,

Sonic

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: composed primary key

2007-04-18 Thread GreyCells

I think you mean compund primary key. See:

http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8217435cc/255c641339eef6ac?lnk=gst&q=compound+primary+key&rnum=1#255c641339eef6ac

Especially Nate's comments. Coincidentally, I had a requirement for
one today - but only because mysql can't recycle sequences...

~GreyCells

On Apr 18, 6:14 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Apr 18, 2007, at 10:08 AM, christianandradet wrote:
>
> > I don't know what to do, how do i define the composed primary key???
>
> Why do you need one? Is 'id' not unique?
>
> -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread GreyCells

Golden Rule #243: Never let the client touch your code. If they don't
understand why it's 'complicated' they are going to break something.
Then they get to keep both parts.

None of my clients have access to the code base  it's mine,
all mine  but some can update their sites via forms. This is
sooo trivial to implement in Cake. I fact only one client even knows
why it's Cake running the show (they don't really care, but their old
spagetti site broke every time a change was made and I wouldn't take
on the maintenance without a re-write...)

I'd be very nervous allowing a third party to introduce potentially
exploitable code into a production site.

~GreyCells

On Apr 18, 5:55 pm, beetlecube <[EMAIL PROTECTED]> wrote:
> For those who have done PHP development for a client, and used cakePHP
> to build their sites, a question:
>
> Have you received complaints from the client, when they have tried to
> add a page on their own, ? like:
>
> "This cakephp stuff is complicated, and I just want to add another
> page that accesses the database, and I didn't know you have to create
> three different files for it.I can't get a php coder to help me,
> because they don't know cakephp or MVC"
>
> Just curious and thought I'd ask
>
> Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: sanitizing data with beforeValidate

2007-04-18 Thread Poncho

Hey Ian,

That code looks pretty nice, could you post the newer version you
mentioned?

Cheers;
Poncho

On Apr 15, 2:41 pm, "ianh" <[EMAIL PROTECTED]> wrote:
> There is 
> this:http://groups.google.co.uk/group/cake-php/browse_thread/thread/6257c7...
> which gives a method you could work from. I have developed it a little
> more since, so if that look useful let me know and I will paste up a
> newer version somewhere. Ianh
>
> On 15 Apr, 04:29, "Poncho" <[EMAIL PROTECTED]> wrote:
>
> > Hello all,
>
> > I'm trying to automaticallysanitizeand reformat phone and fax
> > numbers, so I knocked these model methods together but Ican't seem to
> > get it working.
>
> > function formatPhoneNumbers()
> > {
> > if(isset($this->data[$this->name]) && 
> > count($this->data[$this->name])) {
>
> > $this->log('$this->data['.$this->name.'] is set and is not 
> > empty');
> > foreach($this->data[$this->name] as $key => $value )
> > {
> > if(strpos($key, 'phone') || strpos($key, 'fax')) {
> > $this->formatPhone($key);
> > $this->log("{$key} is being reformatted");
> > }
> > }
> > }
> > else
> > {
> > $this->log('$this->data['.$this->name.'] is not set or is 
> > empty');
> > }
> > return true;
>
> > }
>
> > function formatPhone($field=null)
> > {
> > if(isset($this->data[$this->name][$field]) && 
> > !empty($this->data[$this->name][$field])) {
>
> > $this->data[$this->name][$field] = 
> > preg_replace('/[^0-9]/i', '',
> > $this->data[$this->name][$field]);
> > }
> > return true;
>
> > }
>
> > This is to be used for all forms, so I put the methods in AppModel and
> > call them withbeforeValidatelike so:
>
> > functionbeforeValidate()
> > {
> > $this->formatPhoneNumbers();
> > return true;
>
> > }
>
> > Unfortunately, when I run the form with some data (with fields such as
> > 'daytime_phone', 'evening_phone', 'fax'), the form is repopulated with
> > the data without being reformatted and I get the following message
> > logged:
>
> > 2007-04-15 12:20:09 Error: $this->data[Award] is not set or is empty
>
> > Any help would be greatly appreciated, I may have just overlooked
> > something.
>
> > Cheers;
> > Poncho


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread beetlecube

Thanks Rajesh and all.

I haven't yet done anything with CakePHP, yet, for clients, so I
figured I'd wonder out loud.

It makes sense to me to simply explain the facts of the matter to a
nontechnical customer
..  and after all, there really is no choice regardless,  when you've
been paid to deliver a quality application. A quality application
should always be based on separation of the entities such as
presentation/logic, etc.. whether it's CakePhp or anything else.

Explaining the benefits clearly,  behind using it, should immediately
cancel out the doubts and make them feel even better about their
choice to hire you.

 So a large part, I'd bet, is even preparing ahead of time, your own
summary explanation of why a framework/CMS should be used. So you can
deliver that explanation to them confidently



On Apr 18, 10:26 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Apr 18, 9:55 pm, beetlecube <[EMAIL PROTECTED]> wrote:
>
> > For those who have done PHP development for a client, and used cakePHP
> > to build their sites, a question:
>
> > Have you received complaints from the client, when they have tried to
> > add a page on their own, ? like:
>
> > "This cakephp stuff is complicated, and I just want to add another
> > page that accesses the database, and I didn't know you have to create
> > three different files for it.I can't get a php coder to help me,
> > because they don't know cakephp or MVC"
>
> > Just curious and thought I'd ask
>
>   Some indirect questions received:
> 1. How can I set the site-wide settings?
> 2. How can I edit the pages? Can't I have semi CMS?
> 3. How can the other designer "theme" the site (without CSS)?
>
>   Possible ways to convine the clients:
> 1. Speed. Deliver quick prototypes
> 2. Quite often mention "rails". Every client is crazy of rails these
> days.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread AD7six



On Apr 18, 6:55 pm, beetlecube <[EMAIL PROTECTED]> wrote:
> For those who have done PHP development for a client, and used cakePHP
> to build their sites, a question:
>
> Have you received complaints from the client, when they have tried to
> add a page on their own, ? like:
>
> "This cakephp stuff is complicated, and I just want to add another
> page that accesses the database, and I didn't know you have to create
> three different files for it.I can't get a php coder to help me,
> because they don't know cakephp or MVC"
>
> Just curious and thought I'd ask

I did, well not complaints just confusion. The biggest problem by far
is usually a lack of understanding of how mod_rewrite works coupled
with cakes "black magic". I wrote an interface to do anything asked,
as it was faster than explaining to none techies, and then fixing what
they broke.

Shouldn't apply to anyone who knows (any more than a little) php and
can read though :).

cheers,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 18, 9:55 pm, beetlecube <[EMAIL PROTECTED]> wrote:
> For those who have done PHP development for a client, and used cakePHP
> to build their sites, a question:
>
> Have you received complaints from the client, when they have tried to
> add a page on their own, ? like:
>
> "This cakephp stuff is complicated, and I just want to add another
> page that accesses the database, and I didn't know you have to create
> three different files for it.I can't get a php coder to help me,
> because they don't know cakephp or MVC"
>
> Just curious and thought I'd ask

  Some indirect questions received:
1. How can I set the site-wide settings?
2. How can I edit the pages? Can't I have semi CMS?
3. How can the other designer "theme" the site (without CSS)?

  Possible ways to convine the clients:
1. Speed. Deliver quick prototypes
2. Quite often mention "rails". Every client is crazy of rails these
days.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread Gonzalo Servat
On 4/18/07, beetlecube <[EMAIL PROTECTED]> wrote:
>
>
> For those who have done PHP development for a client, and used cakePHP
> to build their sites, a question:
>
> Have you received complaints from the client, when they have tried to
> add a page on their own, ? like:
>
> "This cakephp stuff is complicated, and I just want to add another
> page that accesses the database, and I didn't know you have to create
> three different files for it.I can't get a php coder to help me,
> because they don't know cakephp or MVC"
>
> Just curious and thought I'd ask


I'm a little bit confused.
When you say "Client", you mean somebody who will be USING your CakePHP app
through a browser?

CakePHP is not exactly hard to learn, and in the long run makes code
far more maintainable. Any half-decent PHP coder can pick up the
CakePHP stuff relatively quickly and any programmer who has done a
bit of OOP should know at least the basics of MVC.

That comment you quoted sounds like somebody not willing to put in a bit of
effort to understand why there are 3 files
needed. Besides, unless you need to do data validation or some
callbacks in the Model, the file is about 3 lines long.
The controller maps out the different actions the user can access and the
views have "what to show". Sounds sensible to me.

Hope this helps.

Regards,
Gonzalo.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: composed primary key

2007-04-18 Thread John David Anderson (_psychic_)


On Apr 18, 2007, at 10:08 AM, christianandradet wrote:

> I don't know what to do, how do i define the composed primary key???

Why do you need one? Is 'id' not unique?

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread John David Anderson (_psychic_)


On Apr 18, 2007, at 10:55 AM, beetlecube wrote:

>
> For those who have done PHP development for a client, and used cakePHP
> to build their sites, a question:
>
> Have you received complaints from the client, when they have tried to
> add a page on their own, ? like:

My clients don't add pages on their own. If they do, its through some  
sort of content management setup. Are you still on the project?

> "This cakephp stuff is complicated, and I just want to add another
> page that accesses the database, and I didn't know you have to create
> three different files for it.I can't get a php coder to help me,
> because they don't know cakephp or MVC"

I teach my clients about the virtues of MVC architecture. The  
downside is more files, the upside is some sort of semblance of  
sanity and organization moving down the road. You can keep your  
entire site in one big file if you want to - I'm pretty sure I know  
how that'd turn out, though. :)

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Your client and cakePHP

2007-04-18 Thread gwoo

you have not told them about pages controller?
/app/views/pages/myclientsfile.thtml
it will even wrap the head and footer.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Your client and cakePHP

2007-04-18 Thread beetlecube

For those who have done PHP development for a client, and used cakePHP
to build their sites, a question:

Have you received complaints from the client, when they have tried to
add a page on their own, ? like:

"This cakephp stuff is complicated, and I just want to add another
page that accesses the database, and I didn't know you have to create
three different files for it.I can't get a php coder to help me,
because they don't know cakephp or MVC"

Just curious and thought I'd ask

Steve


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Simple AJAX auto completion using a select box

2007-04-18 Thread chowsapal

Oh, and of course for your autocomplete controller code, you'll select
something like

concat('[', id, ']: ', title) as field

I guess the whole [id]: thing was overkill -- but I'm sure you can
adjust your autocomplete controller / view code to suit your needs.

On Apr 18, 11:21 am, evenshadowshaveshadows
<[EMAIL PROTECTED]> wrote:
> Looks promising, will give it a try. Thanks for the response.
>
> On 18 Apr, 16:28, chowsapal <[EMAIL PROTECTED]> wrote:
>
> > The regular $ajax->autocomplete isn't a select box, but it functions
> > much like one if the CSS is set right for your ul.  Are you trying to
> > use it in conjunction with a select box?  One thing you could do is
> > run it something like this:
>
> > (in autocomplete.ctp:)
> > 
> > 
> >  > \]: /', '$1', $entry); ?>
> > 
> > 
>
> > (in your view:)
> > autocomplete('Model.field', '/controller/
> > autocomplete', array('size' => '36', 'indicator' => 'field_ind',
> > 'updateElement' => 'updateField')); ?> > id="field_ind" style="display: none; width:30px" />
>
> > (javascript in your view:)
> > function updateField(item) {
> > itemText = item.innerHTML;
> > $('FieldId').value = itemText.replace(/^(\d+)<\/span>(.*)$/, "$1");
> > $('AutocompleteFieldName').value = itemText.replace(/^ > style="display: none;">(\d+)<\/span>(.*)$/, "$2");
>
> > }
>
> > The above code works for a hidden field called Field.id -- I can't
> > remember if you set the value for a select box exactly like that, but
> > I think you get the idea.  Basically, you put the ID for your field in
> > a hidden span inside your list, then hijack the updateElement function
> > of the autocomplete box to fill in the ID of your selected item, as
> > well as the text of the autocomplete field itself.
>
> > HTH
> > -chowsapal
>
> > On Apr 18, 9:34 am, evenshadowshaveshadows
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hello! I'm sort of new to the wonderful world of CakePHP and AJAX.
> > > Anyhow I have now come to a point where I'm kind of stuck and in need
> > > of some tips from more experienced users.
>
> > > In my view /invoices/create I have a form containing:
> > > * A select box containting company names and one special option "New
> > > company"
> > > * A couple of input fields with company information.
>
> > > When an existing company is selected I want to be able to do this:
> > > * Retrieve the company information form my database and fill in the
> > > fields.
> > > * Disable the input fields so that no new data can be inserted.
>
> > > When "New company" option is selected (it is selected by default) I
> > > want to be able to do this:
> > > * Clear the input fields.
> > > * Enable the input fields (if disabled).
>
> > > I've been trying different solutions using AJAX and the onchange event
> > > but I haven't been able to come up with a solution that was good
> > > enough to actually use. I've also been browsing different forums
> > > looking for a really simple example of good auto completion using AJAX
> > > without any real success. What I want is a really really simple
> > > example of how to achieve the above or something similar. I will be
> > > very grateful for any help or tips.
>
> > > Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread gwoo

oh, silly me forgot to mention that the router has full unit test
coverage. So, how about one that proves your case.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread gwoo

you have not shown what your custom routes are.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do I use i18n and l10n in CakePHP 1.2?

2007-04-18 Thread [EMAIL PROTECTED]

To anyone who is looking for answer to this I discovered the answer.
Here are my quick notes on it so far.

INTERNATIONALIZATION

- at top of controller: uses('L10n');
- create /app/locale/eng/LC_MESSAGES/default.po (French is fre/fra)
http://www.loc.gov/standards/iso639-2/php/code_list.php
- create entries in default.po as such:

msgid  "close_window"
msgstr "Close"

msgid  "where_pin"
msgstr "Where is my PIN?"

- call translations in view:  ) ("close_window"
is msgid from default.po)
this is going to echo out the msgstr for the given msgid, else it
wil display the msgid given
use __("button_submit", true) to return the value as opposed to
echoing it

I hope this saves others the time it took me to track it down.

On Apr 13, 4:31 pm, "Aaron Thies" <[EMAIL PROTECTED]> wrote:
> I have been trying to find any kind of documentation on how to use
> i18n and l10n in CakePHP 1.2.  Any help would be appreciated.
>
> --
> Aaron Thies
>
> "When you're married you'll understand the value of fresh produce."
> - Tony Soprano


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



composed primary key

2007-04-18 Thread christianandradet

hi
i need a model to hava a composed primary key i tried with:
var $primaryKey = 'id,Autoridade.cliente_id';
and
var $primaryKey = array('id',cliente_id');

with the first one the next error message is displayed when I try to
edit:
Query: SELECT `Autoridade`.`id`, `Autoridade`.`cliente_id` FROM
`autoridades` AS `Autoridade` LEFT JOIN `autcargos` AS `Autcargo` ON
`Autoridade`.`autcargo_id` = `Autcargo`.`id` LEFT JOIN `juridicos` AS
`Juridico` ON `Autoridade`.`cliente_id` = `Juridico`.`cliente_id`
WHERE `Autoridade`.`id,Autoridade`.`cliente_id` = 2 LIMIT 1
1054: Unknown column 'Autoridade.id,Autoridade.cliente_id' in 'where
clause'

but whe i try with the second one this error is displayed when trying
to see the index:
Query: SELECT COUNT(*) AS count FROM `autoridades` AS `Autoridade`
LEFT JOIN `autcargos` AS `Autcargo` ON `Autoridade`.`autcargo_id` =
`Autcargo`.`id` LEFT JOIN `juridicos` AS `Juridico` ON
`Autoridade`.`cliente_id` = `Juridico`.`cliente_id` WHERE
`autoridade`.`cliente_id` = 8 ORDER BY `Autoridade`.`Array` ASC
1054: Unknown column 'Autoridade.Array' in 'order clause'

I don't know what to do, how do i define the composed primary key???


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Simple AJAX auto completion using a select box

2007-04-18 Thread evenshadowshaveshadows

Looks promising, will give it a try. Thanks for the response.

On 18 Apr, 16:28, chowsapal <[EMAIL PROTECTED]> wrote:
> The regular $ajax->autocomplete isn't a select box, but it functions
> much like one if the CSS is set right for your ul.  Are you trying to
> use it in conjunction with a select box?  One thing you could do is
> run it something like this:
>
> (in autocomplete.ctp:)
> 
> 
>  \]: /', '$1', $entry); ?>
> 
> 
>
> (in your view:)
> autocomplete('Model.field', '/controller/
> autocomplete', array('size' => '36', 'indicator' => 'field_ind',
> 'updateElement' => 'updateField')); ?> id="field_ind" style="display: none; width:30px" />
>
> (javascript in your view:)
> function updateField(item) {
> itemText = item.innerHTML;
> $('FieldId').value = itemText.replace(/^(\d+)<\/span>(.*)$/, "$1");
> $('AutocompleteFieldName').value = itemText.replace(/^ style="display: none;">(\d+)<\/span>(.*)$/, "$2");
>
> }
>
> The above code works for a hidden field called Field.id -- I can't
> remember if you set the value for a select box exactly like that, but
> I think you get the idea.  Basically, you put the ID for your field in
> a hidden span inside your list, then hijack the updateElement function
> of the autocomplete box to fill in the ID of your selected item, as
> well as the text of the autocomplete field itself.
>
> HTH
> -chowsapal
>
> On Apr 18, 9:34 am, evenshadowshaveshadows
>
> <[EMAIL PROTECTED]> wrote:
> > Hello! I'm sort of new to the wonderful world of CakePHP and AJAX.
> > Anyhow I have now come to a point where I'm kind of stuck and in need
> > of some tips from more experienced users.
>
> > In my view /invoices/create I have a form containing:
> > * A select box containting company names and one special option "New
> > company"
> > * A couple of input fields with company information.
>
> > When an existing company is selected I want to be able to do this:
> > * Retrieve the company information form my database and fill in the
> > fields.
> > * Disable the input fields so that no new data can be inserted.
>
> > When "New company" option is selected (it is selected by default) I
> > want to be able to do this:
> > * Clear the input fields.
> > * Enable the input fields (if disabled).
>
> > I've been trying different solutions using AJAX and the onchange event
> > but I haven't been able to come up with a solution that was good
> > enough to actually use. I've also been browsing different forums
> > looking for a really simple example of good auto completion using AJAX
> > without any real success. What I want is a really really simple
> > example of how to achieve the above or something similar. I will be
> > very grateful for any help or tips.
>
> > Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Calling cake actions via cli or cron

2007-04-18 Thread RLR

Thanks for your reply.
I have read that article and almost solved my problem with gwoos cli
code from the bakery.

The session problem still remains though.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax + RequestAction

2007-04-18 Thread mutabor

Thanks AD7six, it seems to be exactly what I was looking for!!!

> http://groups.google.com/group/cake-php/browse_frm/thread/23eb2bfe8ea...
> AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp 1.2 paginate

2007-04-18 Thread Joshua Benner

Jeremy,

I've been using 1.2 for a project, and I've had to ask a lot of
questions, and do even more swimming through the 1.2 code. In the
process though, I'm becoming very familiar with the internals of 1.2,
so I've started to realize that it's a real advantage (despite the
time investment). It's good that we have some people venturing into
the 1.2 arena not only to test the code, but also so that when it
nears release, we can help contribute by answering others' questions
or helping with documentation.

Hang in there, and we'll answer questions whenever we can!

On Apr 18, 3:59 am, Jeremy Pointer <[EMAIL PROTECTED]> wrote:
> Thanks Tarique, your response is appreciated.
>
> */Jeremy Pointer/*
> [EMAIL PROTECTED] 
>
> Dr. Tarique Sani wrote:
> > On 4/17/07, Jeremy Pointer <[EMAIL PROTECTED]> wrote:
>
> >> I don't know what it is guys but every one of my questions I've asked so
> >> far seems to take a fair while to get answered (Maybe I'm asking them
> >> wrong, or maybe my problems are too complicated (or too stupid) and yes
>
> > You are playing with Cake 1.2 which very few other than the core
> > developers know inside out so even though your problems are simple,
> > may be no one has encountered them before
>
> > HTH
> > Tarique


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Simple AJAX auto completion using a select box

2007-04-18 Thread chowsapal

The regular $ajax->autocomplete isn't a select box, but it functions
much like one if the CSS is set right for your ul.  Are you trying to
use it in conjunction with a select box?  One thing you could do is
run it something like this:

(in autocomplete.ctp:)


$1', $entry); ?>



(in your view:)
autocomplete('Model.field', '/controller/
autocomplete', array('size' => '36', 'indicator' => 'field_ind',
'updateElement' => 'updateField')); ?>

(javascript in your view:)
function updateField(item) {
itemText = item.innerHTML;
$('FieldId').value = itemText.replace(/^(\d+)<\/span>(.*)$/, "$1");
$('AutocompleteFieldName').value = itemText.replace(/^(\d+)<\/span>(.*)$/, "$2");
}

The above code works for a hidden field called Field.id -- I can't
remember if you set the value for a select box exactly like that, but
I think you get the idea.  Basically, you put the ID for your field in
a hidden span inside your list, then hijack the updateElement function
of the autocomplete box to fill in the ID of your selected item, as
well as the text of the autocomplete field itself.

HTH
-chowsapal

On Apr 18, 9:34 am, evenshadowshaveshadows
<[EMAIL PROTECTED]> wrote:
> Hello! I'm sort of new to the wonderful world of CakePHP and AJAX.
> Anyhow I have now come to a point where I'm kind of stuck and in need
> of some tips from more experienced users.
>
> In my view /invoices/create I have a form containing:
> * A select box containting company names and one special option "New
> company"
> * A couple of input fields with company information.
>
> When an existing company is selected I want to be able to do this:
> * Retrieve the company information form my database and fill in the
> fields.
> * Disable the input fields so that no new data can be inserted.
>
> When "New company" option is selected (it is selected by default) I
> want to be able to do this:
> * Clear the input fields.
> * Enable the input fields (if disabled).
>
> I've been trying different solutions using AJAX and the onchange event
> but I haven't been able to come up with a solution that was good
> enough to actually use. I've also been browsing different forums
> looking for a really simple example of good auto completion using AJAX
> without any real success. What I want is a really really simple
> example of how to achieve the above or something similar. I will be
> very grateful for any help or tips.
>
> Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread mcgordon

I just ran into this problem and came here looking for more info.  I
haven't had a chance to look into it yet but when I find something
I'll post more.  Just wanted to let you know that yours is not an
isolated case.

Marcel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: strange symbols () ! Help

2007-04-18 Thread DJ Spark

  it's the BOM (2 bytes on the file header).
  in notepad++ just select in the menu 'format' / 'utf-8 without BOM'

  about the difference between the servers, maybe, the odd one is not
sending the file as utf-8 ...


 spark


On 4/18/07, TWIOF <[EMAIL PROTECTED]> wrote:
>
> Hi
>
> I don't know if anyone else out there gets this problem, on my test
> server (xampp on pc) all pages and elements render just fine.
>
> On most client's servers it's ok too.But on the odd one i get the
> following symbols appearing at the top of rendered pages or elements.
>
> I've been sing notepad++ on pc for editing and have had problems with
> while space getting in to the tops of files where there should be
> none. Could this be it? Or is it a server setting? I'm really
> confused,
>
> cheers
>
> TWIOF
>
>
> >
>


-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br/mp3

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Simple AJAX auto completion using a select box

2007-04-18 Thread evenshadowshaveshadows

Hello! I'm sort of new to the wonderful world of CakePHP and AJAX.
Anyhow I have now come to a point where I'm kind of stuck and in need
of some tips from more experienced users.

In my view /invoices/create I have a form containing:
* A select box containting company names and one special option "New
company"
* A couple of input fields with company information.

When an existing company is selected I want to be able to do this:
* Retrieve the company information form my database and fill in the
fields.
* Disable the input fields so that no new data can be inserted.

When "New company" option is selected (it is selected by default) I
want to be able to do this:
* Clear the input fields.
* Enable the input fields (if disabled).

I've been trying different solutions using AJAX and the onchange event
but I haven't been able to come up with a solution that was good
enough to actually use. I've also been browsing different forums
looking for a really simple example of good auto completion using AJAX
without any real success. What I want is a really really simple
example of how to achieve the above or something similar. I will be
very grateful for any help or tips.

Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Calling cake actions via cli or cron

2007-04-18 Thread hepper

Just know that there are an article about cron in the bakery. Haven't
tested it myself yet.
http://bakery.cakephp.org/articles/view/176

On Apr 18, 2:18 pm, RLR <[EMAIL PROTECTED]> wrote:
> I would like to call a controller action with cron that checks and
> processes new registrations at regular intervals. I have created a
> test file: cron.php
>
>  $_GET['url'] = 'favicon.ico';
>
> define('CRON_DISPATCHER',true);
>
> require_once 'webroot/index.php';
>
> $cake_dispatcher=new Dispatcher();
> $result = $cake_dispatcher->dispatch('/admin/writeFile',
> array('return' => 1));
> echo $result;
> ?>
>
> when I try to execute: php cron.php
> I get many warnings about
> PHP Warning:  session_start(): ... cake/libs/session.php on line 146
>
> and the action is not called.
>
> How can I prevent cake from starting a session for cli request?
> Or is there a better approach that I can follow?
>
> Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: isAjax() - how do I use?

2007-04-18 Thread Felix Geisendörfer
>
>   FWIW, I personally feel isAjax is quite unreliable (when under
> Firewall) as it depends on HTTP_X_REQUESTED_WITH header. bare/ajax
> would be ideal, IMHO.
Hm? What Firewalls are filtering out HTTP headers? Is that some sort of 
"anonymous" feature? If you ask me this sounds really bad and hopefully 
is not popular enough to make it worth to put any effort into a work-around!

-- Felix
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


R. Rajesh Jeba Anbiah wrote:
> Danielle Tilley wrote:
>   
>> I am using Cake 1.2
>>
>>  I am trying to add the following function to my app_controller - from 
>> bakery article Redirects with Ajax - 
>> http://bakery.cakephp.org/articles/view/92
>>
>>  ===
>>function redirect($url, $status = null, $die = true) {
>>if ($this->RequestHandler->isAjax() || isset 
>> ($this->params['requested'])) {
>> 
>
>
>   FWIW, I personally feel isAjax is quite unreliable (when under
> Firewall) as it depends on HTTP_X_REQUESTED_WITH header. bare/ajax
> would be ideal, IMHO.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
>
>
> >
>
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How can I do login, grab web pages, parse email with cakephp/php?

2007-04-18 Thread Humble Groups
Yes. But this is closed group, RSS is available only for public groups.

I won't be able to access the messages through mailbox for following
reasons.

1. I won't know the message no yahoo group associated for that message.
2. I won't know the the thread of messages for each message.

Yahoo provides the raw email message as well if you pass another parameter
to the url, so i just grab that, feed to JavaMail API which will give me all
the properties (subject, from, ...) and multipart object, so I don't need to
worry about parsing, etc.,

I also parse the thread of messages using xpath.

On 4/17/07, gwoo <[EMAIL PROTECTED]> wrote:
>
>
> You can run Cake from cli. There are messages on the list that talk
> about it. PHP can interface with mailboxs pretty easily. Does yahoo
> groups have an rss feed?
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Calling cake actions via cli or cron

2007-04-18 Thread RLR

I would like to call a controller action with cron that checks and
processes new registrations at regular intervals. I have created a
test file: cron.php

dispatch('/admin/writeFile',
array('return' => 1));
echo $result;
?>

when I try to execute: php cron.php
I get many warnings about
PHP Warning:  session_start(): ... cake/libs/session.php on line 146

and the action is not called.

How can I prevent cake from starting a session for cli request?
Or is there a better approach that I can follow?

Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



1.2: http://blogs/comments/index/5 -- paginator missing url

2007-04-18 Thread R. Rajesh Jeba Anbiah

Situation:
* Blog project
* Comments/index action/method is slightly patched so that if $id is
present, it will show the listing related only to that Blog[id].
Example: http://blogs/comments/index/5  will show the comments for the
Blog #5.

Problem:

The paginator doesn't remember the url in sortable links--still
showing

http://blogs/comments/index/page:1/sort:id/direction:asc  <-- ignoring
index/5

Anyone knows of any solution? or known bug? I tried to set the url
option in paginator with $this->here, but it's getting added twice.

TIA

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Global css navigation menu from DB

2007-04-18 Thread Andrew McCafferty

Firstly, the $name of AppController isn't "Nodes" so remove that
line...

Try replacing it with:

var $uses = array('Node');

This should tell AppController to use your Node model, making the
findAllThreaded function available.



On 18 Apr, 06:17, double07 <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I'm trying to setup a global css navigation menu. Basically All my
> pages for the site are in a table called 'nodes'. Each page has a
> parent_id so I can use findAllThreaded() to generate an unordered list
> using a 'tree' helper (http://bakery.cakephp.org/articles/view/64) I
> found in the bakery.
>
> Now when I set this up in a specific function within the Nodes
> controller it works fine. example:
>
> In the function 'edit' within the nodes controller I have this bit of
> code:
> $this->set('category_tree', $this->Node->generateList());
>
> In my default layout page I have:
> echo $tree->show('Node/title', $menu);
>
> Obviously this only works when I'm in - /nodes/edit/x
>
> What I want is to have that navigation available on every single page
> so I don't have to set the menu variable in each function in each
> controller. From my research around the place it seems that using
> beforeFilter() in AppController is what I'm looking for, but I'm not
> sure my syntax is correct as I get this error:
> Notice: Undefined property: PagesController::$Node in C:\wamp\www\cake
> \cake\app_controller.php on line 64
> Fatal error: Call to a member function findAllThreaded() on a non-
> object in C:\wamp\www\cake\cake\app_controller.php on line 64
>
> In my app_controller.php file I have:
>
> class AppController extends Controller {
>
> var $name = 'Nodes';
> var $components  = array('othAuth');
> var $helpers = array('Html', 'OthAuth');
> var $othAuthRestrictions = array( 'add','edit','delete');
>
> function beforeFilter()
> {
>
> $this->set('menu', $this->Node->findAllThreaded()); //This is
> the line in question
>
> $auth_conf = array(
> 'mode'  => 'oth',
> 'login_page'  => '/users/login',
> 'logout_page' => '/users/logout',
> 'access_page' => '/',
> 'hashkey' => 'MySEcEeTHaSHKeYz',
> 'noaccess_page' => '/users/noaccess',
> 'strict_gid_check' => false);
>
> $this->othAuth->controller = &$this;
> $this->othAuth->init($auth_conf);
> $this->othAuth->check();
>
> }
>
> }
>
> Could somebody please give me some pointers or tell me if I'm on the
> right track. If not are there any suggestions to achieve what I'm
> trying to do?
>
> Thanks in advance.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: any 1.2 validation example?

2007-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 16, 11:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I need to see how to use validate in 1.2 also?  This page was not
> useful.  How do I bake in order to get validate and invalidate to be
> used?
  

Some useful links on 1.2 validations:
1. http://cakebaker.42dh.com/2007/01/03/validation-with-cakephp-12/
2. http://bin.cakephp.org/view/152660210
3. http://bin.cakephp.org/saved/17626
4. 
http://cheesecake-photoblog.org/doku.php?id=multiple_validations_per_field_in_cakephp_1.2

At least for me, the model.php needs my patch to get the error message
 which also has patch to
bake.php to add new validations quickly.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: isAjax() - how do I use?

2007-04-18 Thread R. Rajesh Jeba Anbiah

Danielle Tilley wrote:
> I am using Cake 1.2
>
>  I am trying to add the following function to my app_controller - from bakery 
> article Redirects with Ajax - http://bakery.cakephp.org/articles/view/92
>
>  ===
>function redirect($url, $status = null, $die = true) {
>if ($this->RequestHandler->isAjax() || isset 
> ($this->params['requested'])) {
   

  FWIW, I personally feel isAjax is quite unreliable (when under
Firewall) as it depends on HTTP_X_REQUESTED_WITH header. bare/ajax
would be ideal, IMHO.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to use parseExtensions

2007-04-18 Thread R. Rajesh Jeba Anbiah

On Apr 14, 3:52 pm, "davyke" <[EMAIL PROTECTED]> wrote:
> i've just download 'cake_1.2.0.4798alpha', i've got this error:
>
> Deprecated: webservices routes are deprecated and will not be
> supported in future versions.  Use Router::parseExtensions() instead.
>
> someone can explain how to use parseExtensions instead webservices.

1.  foo/config/routes.php

Router::parseExtensions();


2.  foo/controllers/blogs_controller.php

var $components = array('RequestHandler');

3.  foo/views/blogs/rss/view.ctp <-- note: the folder (rss)

 


item(array(),
array('title'   => $blog['title'],
'link'  => '/blogs/view/'.$blog['id'],
'description'   => $blog['desc'],
'pubDate'   => $blog['created'],
   )
);
?>



4.  http://foo.com/blogs/view/1.rss  <-- Note: extension

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



strange symbols () ! Help

2007-04-18 Thread TWIOF

Hi

I don't know if anyone else out there gets this problem, on my test
server (xampp on pc) all pages and elements render just fine.

On most client's servers it's ok too.But on the odd one i get the
following symbols appearing at the top of rendered pages or elements.

I've been sing notepad++ on pc for editing and have had problems with
while space getting in to the tops of files where there should be
none. Could this be it? Or is it a server setting? I'm really
confused,

cheers

TWIOF


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: selected radio button with 'value'=>'08:00-12:00'

2007-04-18 Thread szeta

Hello, thanks for your reply!

i found the solution here:
http://groups.google.com/group/cake-php/browse_thread/thread/21b2d153ab4b6d98/e3cd242c5583d029?lnk=gst&q=radio+selected&rnum=2#e3cd242c5583d029

the html code I get is the following:

Time
08:00-12:00
13:00-17:30
08:00-12:00

How can I make "08:00-12:00" as selected?
Any idea?

Best regards
Ralph



On 18 Apr., 13:25, jeko <[EMAIL PROTECTED]> wrote:
> The HTML output should tell you what the problem is. Basically, you
> are supplying a third radio option, check the HTML source, it will
> make sense.
>
> On Apr 18, 5:55 am, szeta <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I found an answer how to select an option in the html-radio helper
> > with the 'value' field in the options-array.
> > It does not work for me:
>
> > radio('Feedback/timeofday',
> > array('08:00-12:00'=>'08:00-12:00','13:00-17:30'=>'13:00-17:30',
> > 'value'=>'08:00-12:00')); ?>
>
> > I am expecting:
> > (*) 08:00-12:00
> > ( ) 13:00-17:30
>
> > But the result looks like:
> > ( ) 08:00-12:00
> > ( ) 13:00-17:30
> > ( ) 08:00-12:00
>
> > What am i doing wrong?
>
> > Regards
> > Ralph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: selected radio button with 'value'=>'08:00-12:00'

2007-04-18 Thread jeko

The HTML output should tell you what the problem is. Basically, you
are supplying a third radio option, check the HTML source, it will
make sense.

On Apr 18, 5:55 am, szeta <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I found an answer how to select an option in the html-radio helper
> with the 'value' field in the options-array.
> It does not work for me:
>
> radio('Feedback/timeofday',
> array('08:00-12:00'=>'08:00-12:00','13:00-17:30'=>'13:00-17:30',
> 'value'=>'08:00-12:00')); ?>
>
> I am expecting:
> (*) 08:00-12:00
> ( ) 13:00-17:30
>
> But the result looks like:
> ( ) 08:00-12:00
> ( ) 13:00-17:30
> ( ) 08:00-12:00
>
> What am i doing wrong?
>
> Regards
> Ralph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



selected radio button with 'value'=>'08:00-12:00'

2007-04-18 Thread szeta

Hello,

I found an answer how to select an option in the html-radio helper
with the 'value' field in the options-array.
It does not work for me:

radio('Feedback/timeofday',
array('08:00-12:00'=>'08:00-12:00','13:00-17:30'=>'13:00-17:30',
'value'=>'08:00-12:00')); ?>


I am expecting:
(*) 08:00-12:00
( ) 13:00-17:30

But the result looks like:
( ) 08:00-12:00
( ) 13:00-17:30
( ) 08:00-12:00

What am i doing wrong?

Regards
Ralph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax + RequestAction

2007-04-18 Thread AD7six



On 18 abr, 09:22, mutabor <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have list of items ( index() in controller ), each item has 'Delete'
> button that point Ajax call to delete() function in controller, then
> updates the div of items.
>
> In delete() function, after actual deletion of record I need to return
> to the same view and call index() function again - to let it again
> generate all listing. And I have problems with it.
>
> Right now I do it like this:
>
> [repeat all code from index() function]
> $this->render('index','ajax');
>
> The solution will be easy if render('index', 'ajax') will not just
> show index view but also call index() in controller before and I would
> not have to repeat code as I do it now.
>
> RequestAction also does not seem to be helpful.
>
> Please help.

IMO it's a bad idea to hardcode the layout to be ajax. for one, if it
isn't an ajax call your pages don't look nice ;).

Probably better to write your code so that it works without using js,
include the RequestHandler component in yoru app controller and
override the redirect function to do something appropriate if called
as part of an ajax call. See:

http://groups.google.com/group/cake-php/browse_frm/thread/23eb2bfe8ea8167e/b01390ae19bfd380?lnk=gst&q=isAjax+requested+redirect&rnum=1#b01390ae19bfd380

hth,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Paginator and custom routes problem (latest 1.2 alpha)

2007-04-18 Thread thequietlab

Hi there,

I've switched to latest 1.2 alpha lately and my paginator stoped
outputting proper url's. It happens only when I use custom routes.
Paginator generates url's without sorting parameters..
Instead of

/:controller/page:1/sort:created/direction:asc

I get

/:controller/:action/

It was working fine with 1.2.0.4451alpha..

So I tracked it down and it seems like it losses all the url params in
router.php : __mapRoute($route, $params = array()) ..

as far as I tracked it, it goes like this :

router.php : url()  checks for each route defined if it fits the
controller path which is processing, line 496 :
if ($match = $_this->mapRouteElements($route, $url)) .. before that
$url array has all the sorting params, then there is :
list($output, $url) = $match;

and $match doesn't keep $url params anymore hence all the params are
lost.

Going further through Router::mapRouteElements() and
Router::__mapRoute() it seems obvious that all the params got lost in
the latter. And I'm not really sure what is happening down there.

Does anybody have similar problem ? Is this a bug ?

Best,
Andrzej


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model SubTypes & Database Design

2007-04-18 Thread AD7six


Hi All,

On 18 abr, 10:06, GreyCells <[EMAIL PROTECTED]> wrote:
> Hi Laptop
>
> Cake uses the active record model, so by convention, expects  a one to
> one relationship between model and table. That said, it is possible
> for multiple models to share the same table by specifying the useTable
> attribute. If you're developing with 1.2, the actsAs could prove an
> alternative to multiple levels of inheritance. (i.e.
> OnlineAdvertisement actsAs Advertisement), although I must confess I
> have not use actsAs in anger yet...

Good idea IMO. And wouldn't be difficult to achieve, just 'injecting'
Model.type_field = 'a type' to all the find and creation queries. The
soft delete behavoir described on the bakery is almost the same
principle.

>
> For models that share mostly the same attributes, a few redundant
> columns in your table is a small price compared to the ease of
> maintenance and that niggling overhead of an extra join. From the
> information you've given, I'd probably treat the Online and/or Print
> as attributes of an Advertisement rather than seperate models. This is
> a bit like vi vs emacs - despite what many will tell you, there is no
> 'right way' from a pure design perspective - hence the multitude of
> ORM tools/projects out there. Just pick the simplest route first and
> refactor if it doesn't work out :)
>
> @gwoo: Are there any technical reasons why PrintAdvertisement cannot
> extend Advertisement? (i.e. framework complications rather that app
> complications).

I've done that before, and (as you would expect) so long as the class
you want to extend is already loaded (either explicitly by your own
code, or because it's loaded first by cake) cake wouldn't know or need
to know there was a class in the middle.

Cheers,

AD


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how should I set up these complex associations?

2007-04-18 Thread Mike Griffin

On 4/13/07, gerbenzomp <[EMAIL PROTECTED]> wrote:
> I think there's something wrong with my associations in general,
> because I get an array that looks different from what I had hoped for,
> and the error stays too. (It goes away when I remove the page->widget
> association, which is in a way understandable, because a page contains
> no widgets: a page contains layers, which in turn contain widgets.

I think you don't need a relationship between the page and widget then
in that case.
Page hasMany Layer
Layer hasMany Widget

Is this more like what you are looking for?

If you think more in those terms, it will be easier for you to figure
out how to lay out your design.  I dont really understand what you are
trying to do with it all though.

Mike.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model SubTypes & Database Design

2007-04-18 Thread GreyCells

Hi Laptop

Cake uses the active record model, so by convention, expects  a one to
one relationship between model and table. That said, it is possible
for multiple models to share the same table by specifying the useTable
attribute. If you're developing with 1.2, the actsAs could prove an
alternative to multiple levels of inheritance. (i.e.
OnlineAdvertisement actsAs Advertisement), although I must confess I
have not use actsAs in anger yet...

For models that share mostly the same attributes, a few redundant
columns in your table is a small price compared to the ease of
maintenance and that niggling overhead of an extra join. From the
information you've given, I'd probably treat the Online and/or Print
as attributes of an Advertisement rather than seperate models. This is
a bit like vi vs emacs - despite what many will tell you, there is no
'right way' from a pure design perspective - hence the multitude of
ORM tools/projects out there. Just pick the simplest route first and
refactor if it doesn't work out :)

@gwoo: Are there any technical reasons why PrintAdvertisement cannot
extend Advertisement? (i.e. framework complications rather that app
complications).

~GreyCells

On Apr 18, 4:46 am, gwoo <[EMAIL PROTECTED]> wrote:
> no, they woudl still exend AppModel.
>
> OnlineAdvertisment belongsTo Advertisement
>
> I was thinking of it like User and Profile where the Advertisement is
> like the User and the OnlineAdvertisment holds specifc details about
> the Ad, like a Profile would.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp 1.2 paginate

2007-04-18 Thread Jeremy Pointer

Thanks Tarique, your response is appreciated.

*/Jeremy Pointer/*
[EMAIL PROTECTED] 


Dr. Tarique Sani wrote:
> On 4/17/07, Jeremy Pointer <[EMAIL PROTECTED]> wrote:
>   
>> I don't know what it is guys but every one of my questions I've asked so
>> far seems to take a fair while to get answered (Maybe I'm asking them
>> wrong, or maybe my problems are too complicated (or too stupid) and yes
>> 
>
> You are playing with Cake 1.2 which very few other than the core
> developers know inside out so even though your problems are simple,
> may be no one has encountered them before
>
> HTH
> Tarique
>   

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp 1.2 paginate

2007-04-18 Thread Dr. Tarique Sani

On 4/17/07, Jeremy Pointer <[EMAIL PROTECTED]> wrote:
>
> I don't know what it is guys but every one of my questions I've asked so
> far seems to take a fair while to get answered (Maybe I'm asking them
> wrong, or maybe my problems are too complicated (or too stupid) and yes

You are playing with Cake 1.2 which very few other than the core
developers know inside out so even though your problems are simple,
may be no one has encountered them before

HTH
Tarique
-- 
=
PHP for E-Biz: http://sanisoft.com
Cheesecake-Photoblog needs you!: http://cheesecake-photoblog.org
=

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp 1.2 paginate

2007-04-18 Thread Jeremy Pointer

For anyone interested I solved/got around this problem myself see 
https://trac.cakephp.org/ticket/2457

*/Jeremy Pointer/*
[EMAIL PROTECTED] 


Jeremy Pointer wrote:
> I don't know what it is guys but every one of my questions I've asked so 
> far seems to take a fair while to get answered (Maybe I'm asking them 
> wrong, or maybe my problems are too complicated (or too stupid) and yes 
> I know we are all volunteers here so I'm not complaining just wondering 
> if there is something I can do to make my questions clearer), anyway as 
> it is I did spot a few bits of fog in last nights question when I reread 
> it, so I'm replying to myself to clarify a little. Comments in between 
> original question.
>
> */Jeremy Pointer/*
> [EMAIL PROTECTED] 
>
>
> Jeremy Pointer wrote:
>   
>> In my orders controller I have the following (The idea is to use the 
>> orders index view to show a list of orders for a contact, the contact 
>> could be a patient or an Audiologist (If it's an audiologist they might 
>> be the dispensing or delivery audiologist (don't ask I also thought it 
>> was madness but anyway thats what the client needs)) I call this with a 
>> requestAction in the view. Mainly because I can't quite figure how to do 
>> this properly in the model for contacts I have the Orders model set up 
>> with BelongsTo for each contact type but my brain ain't working to work 
>> the other way around.
>> belongsTo of order.php model
>>   var $belongsTo = array(
>>
>> 'DispensingPractice'=>array('className'=>'Practice','foreignKey'=>'disp_practice_id',),
>>'DispensingAudiologist'=>array('className'=>'Contact',
>>
>> 'foreignKey'=>'disp_contact_id',
>>
>> 'conditions'=>"`DispensingAudiologist`.`type`='Audiologist'"),
>>
>> 'DeliveryPractice'=>array('className'=>'Practice','foreignKey'=>'deliv_practice_id'),
>>
>> 'DeliveryAudiologist'=>array('className'=>'Contact','foreignKey'=>'deliv_contact_id',
>>
>> 'conditions'=>"`DeliveryAudiologist`.`type`='Audiologist'"),
>>
>> 'Patient'=>array('className'=>'Contact','foreignKey'=>'patient_id',
>>
>> 'conditions'=>"`Patient`.`type`='Patient'"),   
>> );
>>
>>  
>> 
> In my orders_controller I have :
>   
>>function OrdersByContact($id) {
>> $this->Order->recursive = 0;
>> 
>> $conditions=array('OR'=>array("Order.patient_id"=>$id,"Order.disp_contact_id"=>$id,"Order.deliv_contact_id"=>$id));
>> 
>> $orders=$this->paginate('Order',array('conditions'=>$conditions));
>> if (!isset($type) || $type=='') $type='%';
>> $this->set(compact('orders','type'));
>> $this->render('index');
>> }
>>
>> This generates the count query as below and a similar full query, 
>> unfortunately mysql is choking on this query I have to kill the process:
>>
>> SELECT COUNT(*) AS count FROM `orders` AS `Order` LEFT JOIN `practices` 
>> AS `DispensingPractice` ON (`Order`.`disp_practice_id` = 
>> `DispensingPractice`.`id`) LEFT JOIN `contacts` AS 
>> `DispensingAudiologist` ON (`DispensingAudiologist`.`type`='Audiologist' 
>> AND `Order`.`disp_contact_id` = `DispensingAudiologist`.`id`) LEFT JOIN 
>> `practices` AS `DeliveryPractice` ON (`Order`.`deliv_practice_id` = 
>> `DeliveryPractice`.`id`) LEFT JOIN `contacts` AS `DeliveryAudiologist` 
>> ON (`DeliveryAudiologist`.`type`='Audiologist' AND 
>> `Order`.`deliv_contact_id` = `DeliveryAudiologist`.`id`) LEFT JOIN 
>> `contacts` AS `Patient` ON (`Patient`.`type`='Patient' AND 
>> `Order`.`patient_id` = `Patient`.`id`) LEFT JOIN `repairorders` AS 
>> `Repairorder` ON (`Repairorder`.`order_id` = `Order`.`id` AND ( 
>> `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( 
>> `Order`.`deliv_contact_id` = 594)) LEFT JOIN `hearingaidorders` AS 
>> `Hearingaidorder` ON (`Hearingaidorder`.`order_id` = `Order`.`id` AND ( 
>> `Order`.`patient_id` = 594) OR ( `Order`.`disp_contact_id` = 594) OR ( 
>> `Order`.`deliv_contact_id` = 594)) WHERE (`Order`.`patient_id` = 594) OR 
>> (`Order`.`disp_contact_id` = 594) OR (`Order`.`deliv_contact_id` = 594)
>>
>> If however I remove the additional conditions from the JOIN ON's and 
>> only keep them in the WHERE and run the query manually mysql does not 
>> choke.So I wonder :
>> a) why does paginate generate the conditions in every JOIN clause
>> b) Is there a way for me to remove them.
>> c) Should I set up the model better ( I haven't got a contact->orders 
>> relationship set up in my contact model if I wanted to what would it 
>> need to lo

Ajax + RequestAction

2007-04-18 Thread mutabor

Hello,

I have list of items ( index() in controller ), each item has 'Delete'
button that point Ajax call to delete() function in controller, then
updates the div of items.

In delete() function, after actual deletion of record I need to return
to the same view and call index() function again - to let it again
generate all listing. And I have problems with it.

Right now I do it like this:

[repeat all code from index() function]
$this->render('index','ajax');

The solution will be easy if render('index', 'ajax') will not just
show index view but also call index() in controller before and I would
not have to repeat code as I do it now.

RequestAction also does not seem to be helpful.

Please help.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---