Products HABTM Products

2006-11-27 Thread Soulhuntre

Hey all! Ok I looked everywhere. Now I am confuzzled.

I have a simple problem ... I have Products that can have an arbitrary
number of other products "Related" to them. I have a "products" table,
and a "products_products" table. The products_products table has
"product_id" and "related_id" as the fields.

Here is my Product model.


array('className' => 'Product',
'joinTable' => 
'products_products',
'foreignKey' => 'product_id',
'associationForeignKey' => 
'related_id',
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'uniq' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
),

);

}
?>

However, after a bake creating the controller and views (with sane
options) the edit page, it no work. it lists the other products by name
in a select list, but it never actually stores the associations int he
products_producs table.


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread Mariano Iglesias

That's weird. I had an old version of my app where I needed to access models
and I remember having to do:

if (!isset($this->Model))
{
$this->Model =& new Model();
}

Or something. But since I took out the need to have models on beforeFilter()
I'm not completely sure if that's what the case.

Anyway, good to know :)

-MI

---

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

BAKE ON!

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 28 de Noviembre de 2006 02:38 a.m.
Para: Cake PHP
Asunto: Re: beforeFilter Problem


Actually they are.  Everything is instantiated in the controller's
constructor, except for helpers.


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread nate

Actually they are.  Everything is instantiated in the controller's
constructor, except for helpers.


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread Mariano Iglesias

I think he meant models. Models aren't instantiated at beforeFilter.

-MI

---

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

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 28 de Noviembre de 2006 01:46 a.m.
Para: Cake PHP
Asunto: Re: beforeFilter Problem


I think you're thinking of the startup callback, which gets called
after beforeFilter.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Approval process for Bakery articles

2006-11-27 Thread Mariano Iglesias

Guys,

Any way we can speed it up? I have two articles pending authorization. Give
it one of them was just added, but the other one was added last week.

Maybe we can do community voting, kind of like drupal and most other CMS,
where when an article receives over N posts it gets published, but also an
admin (you VIP people) can come in and override this.

-MI

---

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

BAKE ON!


--~--~-~--~~~---~--~~
 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: object-based models

2006-11-27 Thread Mariano Iglesias

I know baby. I was talking more into those coffe talks when you talk about
what would be an interesting addition to the language.

Like operator overloading. So beautiful... Even people at MS realized this
and added it to C#.

Damn, damn, double damn. Why can Java have it?

Oh well, that's a whole other issue :)

-MI

---

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

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Martes, 28 de Noviembre de 2006 01:33 a.m.
Para: Cake PHP
Asunto: Re: object-based models


It's Java, you *can't* work outside of objects. ;-)



--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread nate

I think you're thinking of the startup callback, which gets called
after beforeFilter.


--~--~-~--~~~---~--~~
 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: object-based models

2006-11-27 Thread nate

It's Java, you *can't* work outside of objects. ;-)


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Blog tutorial view and edit post error

2006-11-27 Thread jacmgr

I tried back in July and encountered this same problem and gave up on
cake.  I recently came back and loaded the latest stable version of
cake and using the latest pdf manual re-did the BLOG tutorial.

On my localhost windows machine running apache/php4 I have these
symptoms:
Index page displays great with list of all records.
Add Post correctly adds post.
Delete Properly correctly deletes post.

Problems:
Display a post and EDIT a post both cause a server error "500 Internal
Server Error"

When I upload to my paid hosting server using php4 EVERYTHING PROPERLY
WORKS exactly according to tutorial.

I tried some of the sample apps (bookmark, rdBloggery) and experienced
the same problem for reading a single record for display or edit but
not for adding or deleting or listing all records.  Adding and deleting
records works perfectly.  (These samples also worked properly on my
paid hosting server, just not on my local machine)

Somaybe my localhost server setup has a unique problem?

I am not smart enough to know what to fix on my local apache server? If

anyone has ideas, please let me know!!

I'd really like to learn and use cake, but I can't get through this
problem!

John Del Ferro


--~--~-~--~~~---~--~~
 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: PayPal Direct Payment API Component

2006-11-27 Thread Mariano Iglesias

Sure, no problem.

Let's hope the article gets approved soon so you all can take a look at it.

-MI

---

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

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Claudio Poli ?
Enviado el: Martes, 28 de Noviembre de 2006 12:17 a.m.
Para: Cake PHP
Asunto: Re: PayPal Direct Payment API Component

whoa Mariano, thanks for that, I will look into it soon :)


--~--~-~--~~~---~--~~
 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: PayPal Direct Payment API Component

2006-11-27 Thread Claudio Poli 

whoa Mariano, thanks for that, I will look into it soon :)


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread Adrian Godong
Yes, components DO get loaded before CakePHP access beforeFilter. You might
haven't add the component to the controller $components variable.

On 11/28/06, Synchro <[EMAIL PROTECTED]> wrote:
>
>
>
> Adrian Godong wrote:
> > Hi, I'm trying to implement some user authentication system, and need to
> > check current user (from session) on every controller call. I've tried
> > placing a beforeFilter method on AppController, but this method doesn't
> seem
> > to be executed.
> >
> > When I put the beforeFilter on one of the controller, it works.
> >
> > Does my controller overrides AppController's beforeFilter even though it
> is
> > not declared?
>
> I ran into something similar - beware that beforeFilter is called
> before any components get setup called on them, so essentially you
> can't use components in beforeFilter.
>
>
> >
>


-- 
Adrian Godong
[EMAIL PROTECTED]

Microsoft Student Ambassador


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---


CakePHP Screencasts not working

2006-11-27 Thread AC

Hello,

  I am trying to view the CakePHP screencasts and I am unable to play
the blog tutorial.  I can forward through it, but I can not actually
play it.  Also, the sound on the other screencasts do not work.  Any
tips?  Suggestions?

Thanks,

AC


--~--~-~--~~~---~--~~
 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: Sessions and amfphp

2006-11-27 Thread grandpa



On Nov 27, 5:05 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I have not yet used amf in cake, so I can't offer any specific advice.
> But two possible work-a-rounds
>
> Option 1: Get the record id first (ie. insert a blank record into your
> database), then send the record id with the file upload.
>
> Option 2: pass thesessionid with the file your uploading. Use thesessionid to 
> manually start thesession.

Option 2 is what I am already doing, but Cake's check for userAgent
makes that impossible since Flash != Firefox. It sends
a different userAgent. That is why I had to remove the security check.
I assume this ONLY happens when using the FileReference
API in Flash 8 and up and not when doing any other url request in flash
- since the amfphp package works WITH this extra check in place.

Option 1 would work of course... didn't think of that really, but it
would mean more method calls / roundtrips. Perhaps I'll do something
like that... since
this ONLY concerns the file uploading part of my app.


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread Mariano Iglesias

You CAN use components in beforeFilter:

function beforeFilter()
{
if ($this->Session->check('User'))
{
echo 'USER is there'; 
exit;
}
else
{
echo 'USER is not there';
exit;
}
}

Try that.

He had another issue.

-MI

---

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

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Synchro
Enviado el: Lunes, 27 de Noviembre de 2006 09:27 p.m.
Para: Cake PHP
Asunto: Re: beforeFilter Problem

I ran into something similar - beware that beforeFilter is called
before any components get setup called on them, so essentially you
can't use components in beforeFilter.


--~--~-~--~~~---~--~~
 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 make my phpmailer component in bakery works?

2006-11-27 Thread ERic ZoU

Thanks. There is A *SPACE* after the ?>. IT works!

BUT, someone help me about the content inside. I sent the e-mail
sucessful. BUT, it contains nothing.

It should be the pro. about the template. I add some testing info. in
the email_body_html.thtml and the email_body_plain.thtml

BUT there is nothing inside the email I received.

Someone help me give some sample about the template? 

More appreciate!


--~--~-~--~~~---~--~~
 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: create dynamically uses

2006-11-27 Thread Grant Cox

Felix - you are correct.  I hadn't actually used loadModel yet, only
just heard PhpNut mention it.

As I have a lot of instances in my cake app where I occasionally need a
bunch of other models, I made a function to instantiate them too.  I've
got this in my bootstrap.php

function attachModel( $model_names, &$instance )
{
if ( !is_array($model_names) ) $model_names = 
array($model_names);

foreach ( $model_names as $model_name ){
if ( !isset($instance->{$model_name}) ){

if ( !class_exists($model_name) ){
loadModel($model_name);
}

if ( class_exists($model_name) ){
$instance->{$model_name} = &new 
$model_name();
}
}
}
}

and use via

attachModel( 'User', $this )  // creates $this->User
attachModel( array('User','Post'), $this )  // creates $this->User and
$this->Post

Since I always want "$this" as the second parameter, is there a way to
detect the caller instance from this function?



On Nov 27, 9:33 am, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
> > $this->loadModel( 'YourModel' );I might be wrong, but I think loadModel is 
> > a global function and does
> not belong to the Controller class?
>
> -- Felix Geisendörfer aka the_undefined
> --http://www.thinkingphp.orghttp://www.fg-webdesign.de
>
> Grant Cox wrote:
> > use
>
> > $this->loadModel( 'YourModel' );
> > $this->YourModel = &new YourModel();
>
> > On Nov 25, 9:51 am, "Ismael S. Kafeltz" <[EMAIL PROTECTED]> wrote:
>
> >> I would like to know whether i did a noob question or it is impossible.
> 
> >> =(


--~--~-~--~~~---~--~~
 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: object-based models

2006-11-27 Thread nate

Agile?  Uh, have you seen how many native PHP functions there are for
manipulating arrays?  On top of that, Cake 1.2 has a bunch of
additional features for manipulating array data.

As far as the code above, can you say "straw man"?

http://en.wikipedia.org/wiki/Straw_Man


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



How can I provide multiple routes to the same app?

2006-11-27 Thread Synchro

I have a video CMS app that effectively needs two user interfaces - a
regular scaffolding-style user interface, and a simple interface that's
used by video player apps. The problem is that the way the video app
one needs to work interferes with cake's usual routing.

For example, I want to be able to view standard editing pages like:

http://www.myapp.com/videos/edit/23

in the usual controller/action style.

At the same time I need to be able to get into the same cake app via a
URL like:

http://www.myapp.com/accountname/someclip.mov

or possibly with a different hostname for the alternative route:

http://video.myapp.com/accountname/someclip.mov

How can I set up the routing so that it doesn't try to call an action
called 'someclip.mov' in a non-existent 'accountname' controller?

Can I set up these two routes at the same time in a way that they won't
interfere with each other? Would the alternative hostname help, and can
cake respond on two subdomains at once in the same app?


--~--~-~--~~~---~--~~
 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: beforeFilter Problem

2006-11-27 Thread Synchro


Adrian Godong wrote:
> Hi, I'm trying to implement some user authentication system, and need to
> check current user (from session) on every controller call. I've tried
> placing a beforeFilter method on AppController, but this method doesn't seem
> to be executed.
>
> When I put the beforeFilter on one of the controller, it works.
>
> Does my controller overrides AppController's beforeFilter even though it is
> not declared?

I ran into something similar - beware that beforeFilter is called
before any components get setup called on them, so essentially you
can't use components in beforeFilter.


--~--~-~--~~~---~--~~
 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 'offset' instead of 'page' in FindAll query?

2006-11-27 Thread Mariano Iglesias

Then what was it?

-MI

---

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

BAKE ON!


-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Lunes, 27 de Noviembre de 2006 08:28 p.m.
Para: Cake PHP
Asunto: Re: How do I use 'offset' instead of 'page' in FindAll query?

Yes, I know.  That wasn't what I was referring to.


--~--~-~--~~~---~--~~
 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 'offset' instead of 'page' in FindAll query?

2006-11-27 Thread nate

Yes, I know.  That wasn't what I was referring to.

Mariano Iglesias wrote:
> That's why if you look at it I'm calling the ceil() function.
>
> -MI
>
> -Mensaje original-
> De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
> de [EMAIL PROTECTED]
> Enviado el: Lunes, 27 de Noviembre de 2006 06:10 a.m.
> Para: Cake PHP
> Asunto: Re: How do I use 'offset' instead of 'page' in FindAll query?
>
> Mariano Iglesias wrote:
> > Thus,
> >
> > $offset = 20;
> > $limit = 10;
> >
> > $this->Model->findAll($conditions, $fields, $order, $limit, ceil(1 +
> > $offset/$limit));
> >
> > Just wanted to look smart
> >
> > -MI
>
> Your example only works if the result of $offset/$limit is an integer.
> You need to take the rounding function out.


--~--~-~--~~~---~--~~
 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 make my phpmailer component in bakery works?

2006-11-27 Thread Grant Cox

Make sure you don't have any whitespace (ie a new line) after the
closing php tag, in the components/email.php file.

I'm not sure why it would say the message has been sent, I haven't used
that component.


--~--~-~--~~~---~--~~
 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: Download as CSV

2006-11-27 Thread Matt Adams

Jeff wrote:
> Hi,
>  I would like to download all my table data as a CSV file.
> How to do that using cake? Please help
> Thanks in advance.

You're likely going to want to look at iterating over your data set if 
it's of any large size (1000's of records or more).


Cheers,

Matt
-- 
BASIC: A programming language.  Related to certain social diseases
in that those who have it will not admit it in polite company.

--~--~-~--~~~---~--~~
 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: Bug Reporting + Contrib...

2006-11-27 Thread Ryders

Great! I will!

Cheers Daniel!


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Pablo Viojo
Yes I know, forget the "pattern" term.

On 11/27/06, nate <[EMAIL PROTECTED]> wrote:
>
>
> Pablo, there is no software design pattern called ActiveResource.
> ActiveResource is an ActiveRecord-like implementation for accessing
> resources over HTTP.
>
>
> >
>


-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Mariano Iglesias

Oh well.

So I was right in the end ;)

-MI

---

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

BAKE ON!

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de nate
Enviado el: Lunes, 27 de Noviembre de 2006 06:16 p.m.
Para: Cake PHP
Asunto: Re: Active Resource Implementation


Pablo, there is no software design pattern called ActiveResource.
ActiveResource is an ActiveRecord-like implementation for accessing
resources over HTTP.


--~--~-~--~~~---~--~~
 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: Associations and Scaffolding

2006-11-27 Thread Dave Barter

Chris

I whoeheartedly agree with the FAQ point. In fact, I am writing down
all of the stuff I have not found in the manual and will submit it as
sugested changes or FAQs.

Please be assured that I have read every inch of the manual, but it did
not cover the two issues/solutions I have raised above. The manual is
brilliant though and there is no way I would even have started without
it. One minor critisim is that it would have been great to build the
BLOG application as a fully featured app. from start to finish that
included all of the main features of Cake. This could then be used as
an excellent point of reference to answer most queries.

Funnilly enough I was unhappy to use bake for the exact reason that
Chris stated, ie. I want to build my cake application ground up and
understand it as I go along.


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Mariano Iglesias
Sorry, my bad :-)

 

Maybe I've put another issue on the table with my mistake ;)

-MI

---

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

BAKE ON!

  _  

De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Pablo Viojo
Enviado el: Lunes, 27 de Noviembre de 2006 04:27 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: Active Resource Implementation

 

Mariano,

I'n not asking about Active Record Pattern but Active Resource as presented
by David Heinemeier  at the RailsConf. More information can be found at
[1],[2] and [3]

Regards,





--~--~-~--~~~---~--~~
 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: object-based models

2006-11-27 Thread Mariano Iglesias

There are so many developers thinking of arrays as a TABU.

Some people still don't get it: use your language of choice for what it is
good for. Don't push stuff your language was not designed to handle.

Like when you talk to java developers (I've been developing java for 9 years
now) most of them think it is a suicide to work outside of objects. I mean
we even have objects to handle indexed arrays. Talk to C++ developers
(working with C++ for 12 years) and they think any language that doesn't
support templates is bull. So on and so on...

So I wouldn't mind what every one think about every little aspect. The truth
is PHP works fine with arrays, so let's keep the arrays. Don't worry; your
code won't look "less cool" because you use arrays at some point.

-MI

---

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

BAKE ON!

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de John David Anderson (_psychic_)
Enviado el: Lunes, 27 de Noviembre de 2006 05:59 p.m.
Para: cake-php@googlegroups.com
Asunto: Re: object-based models


> no offense to the cakephp developers.  i like cakephp, but array-based
> model data???

Yes.

>   really???

Oh yes.


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread nate

Pablo, there is no software design pattern called ActiveResource.
ActiveResource is an ActiveRecord-like implementation for accessing
resources over HTTP.


--~--~-~--~~~---~--~~
 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: object-based models

2006-11-27 Thread John David Anderson (_psychic_)


On Nov 27, 2006, at 1:19 PM, Evan wrote:

>
> i've read some posts here about object-based models in cakephp being
> released for v2.0.  it's great that the cakephp developers are trying
> to do this.  to be honest, i really hate the array-based model in v1.x
> right now.  it's just not as agile and not as dry/yagni as i thought
> cake was.
>
> 

Did you want some help on improving that code, or is this just a  
rant? We're very open to help and suggestions, and as you can see,  
we're already on the way to the object goodness you're after.

> these are but one of the things that make me want to pull all hair off
> my head and curse the fact that my clients hosts do not support rails
> or at least have upgraded to php5 to support symfony.

I'm not sure others would share your opinion that Symfony is more  
agile that Cake, and rails is a whole different ball of wax.

> no offense to the cakephp developers.  i like cakephp, but array-based
> model data???

Yes.

>   really???

Oh yes.

>   how agile could this be?

As agile as you can possibly get on PHP4, which is a significant part  
of our target user base (for now). In order for Cake to get the  
momentum it has, we had to support PHP4. That's why we did it the way  
we did. If you'd like to help us get moving (faster) toward a more  
object-oriented model, please contact one of the team to see where  
you can help out.

-- 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
-~--~~~~--~~--~--~---



object-based models

2006-11-27 Thread Evan

i've read some posts here about object-based models in cakephp being
released for v2.0.  it's great that the cakephp developers are trying
to do this.  to be honest, i really hate the array-based model in v1.x
right now.  it's just not as agile and not as dry/yagni as i thought
cake was.

imagine having to do this in afterFind():

function afterFind(&$results)
{
if (is_array($results))
{
foreach (array_keys($results) as $i)
{
// For model finds

if (isset($results[$i]['CartItem']))
{
$results[$i]['CartItem']['giftwrapping_price']
= $results[$i]['CartItem']['giftwrap']
* $results[$i]['CartItem']['quantity']
* GIFTWRAPPING_CHARGE;
$results[$i]['CartItem']['total_price']
= $results[$i]['CartItem']['availability']
* $results[$i]['CartItem']['quantity']
* $results[$i]['Product']['price']
+
$results[$i]['CartItem']['giftwrapping_price'];
}

if (isset($results[$i]['Product']))
{
$results[$i]['Product'] =
$this->Product->afterFind($results[$i]['Product']);
}

// For association finds

if (isset($results[$i]['CartItems']))
{
foreach (array_keys($results[$i]['CartItems']) as
$ii)
{

$results[$i]['CartItems'][$ii]['giftwrapping_price']
=
$results[$i]['CartItems'][$ii]['giftwrap']
*
$results[$i]['CartItems'][$ii]['quantity']
* GIFTWRAPPING_CHARGE;
$results[$i]['CartItems'][$ii]['total_price']
=
$results[$i]['CartItems'][$ii]['availability']
*
$results[$i]['CartItems'][$ii]['quantity']
*
$results[$i]['CartItems'][$ii]['Product']['price']
+
$results[$i]['CartItems'][$ii]['giftwrapping_price'];

if
(isset($results[$i]['CartItems'][$ii]['Product']))
{
$results[$i]['CartItems'][$ii]['Product'] =
$this->Product->afterFind(

$results[$i]['CartItems'][$ii]['Product']);
}

}
}

}
}

return $results;
}


these are but one of the things that make me want to pull all hair off
my head and curse the fact that my clients hosts do not support rails
or at least have upgraded to php5 to support symfony.

no offense to the cakephp developers.  i like cakephp, but array-based
model data???  really???  how agile could this be?


--~--~-~--~~~---~--~~
 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: hierarchical path

2006-11-27 Thread nate

Try this:
http://api.cakephp.org/class_model.html#181aefe1bf7efe1504692c485c83caa8

Or, you can read up on self-joins:
http://groups.google.com/group/cake-php/search?group=cake-php&q=self+joins&qt_g=1&searchnow=Search+this+group


--~--~-~--~~~---~--~~
 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: Column names truncated

2006-11-27 Thread nate

This is an MSSQL-specific issue that was fixed a couple of releases
ago.  Please pick up the latest version from CakeForge.


--~--~-~--~~~---~--~~
 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: Associations and Scaffolding

2006-11-27 Thread Chris Hartjes

On 11/27/06, Christoph <[EMAIL PROTECTED]> wrote:
>
> You might want to try using the bake.php utility.  It's use was
> invaluable to me to get my feet wet and everything up and running
> quickly.
>

Perhaps this isn't a valid observation, but I have seen more problems
coming out of people using bake.php to create scaffolding and then
struggling to figure out why their customized code doesn't work.  I
never used bake.php, never used Rails scaffolding either and I seem to
be doing okay. Your mileage may vary.

I'm not saying bake.php is useless, I'm saying that I think it's a
crutch that some people are using instead of actually bothering to
understand how CakePHP actually works.  There are many problems being
presented on this list that would be easily fixed if people would
bother to read the manual and search this newsgroup.

Before everyone gets up in arms, yes, I do actually enjoy helping
people out by answering their questions.  I see people that look to me
like they are simply not bothering to take a look at the quite large
amounts of documentation that is available via either searching this
newsgroup or actually going to cakephp.org and READING the manual.

We really need an FAQ that we can point people to.

-- 
Chris Hartjes

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

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

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



RE: Active Resource Implementation

2006-11-27 Thread Christian Winther [cwi.dk]
Ah okay, i know of that pattern very well, thanks J

 

From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Mariano Iglesias
Sent: 27. november 2006 19:07
To: cake-php@googlegroups.com
Subject: RE: Active Resource Implementation

 

He meant Active Record Pattern:

 

 
http://en.wikipedia.org/wiki/Active_Record

Active record is an approach to reading data from a database. A row in a
database table or view is wrapped into a class, thus an object instance is
tied to a single row in the database. After creation of an object, a new row
is added to the database upon save. Any object loaded gets its information
from the database; when an object is updated, the corresponding row in the
database is also updated. The wrapper class implements accessor methods for
each column in the table or view.

-MI

---

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

BAKE ON!

  _  

De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Christian Winther [cwi.dk]
Enviado el: Lunes, 27 de Noviembre de 2006 02:45 p.m.
Para: cake-php@googlegroups.com
Asunto: RE: Active Resource Implementation

 

Can you guide me to some information regarding Active Resource Pattern -
couldn't find anything on google looking like it



 



--~--~-~--~~~---~--~~
 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: Associations and Scaffolding

2006-11-27 Thread Christoph

> So, according to me I have done everything right and I go to:-
> http://www./Addresses and can enter and list addresses.
> Brilliant!
> BUT, if I go to http://www./Customers/edit/, I cannot see the
> association with Addresses which should have been picked up
> automatically by the Foreign Key (address_id)
> All I get is a text box called "Address Id".
> Any ideas what I have done wrong here? I tried adding the following
> association to the Customer model but that did not work either.

You might want to try using the bake.php utility.  It's use was
invaluable to me to get my feet wet and everything up and running
quickly.

thnx,
Christoph


--~--~-~--~~~---~--~~
 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: Does cake protect against SQL hacks automatically?

2006-11-27 Thread nate

http://groups.google.com/group/cake-php/search?group=cake-php&q=sql+injection&qt_g=1&searchnow=Search+this+group


--~--~-~--~~~---~--~~
 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 echo [returns] in cake

2006-11-27 Thread gabordemeter

Thanks John! nl2br() works great!



On Nov 27, 11:52 am, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Nov 27, 2006, at 9:34 AM, gabordemeter wrote:
>
>
>
>
>
> > Hi! I'll give an example to illustrate my problem:
>
> > I have a form which, among other fields, contains a textarea.
>
> > In the textarea area I write the following:
>
> > - abc
>
> > - cde
>
> > Basically I first write the string "- abc", then I hit [return] twice
> > and then write the string "- cde".
>
> > After I save my form, I go to phpMyAdmin and view the respective
> > record. It correctly shows "- abc" on the first row, then there's a
> > blank row (due to the two returns i inserted) and then, on the third
> > row it shows the string "- cde".
>
> > So far so good. And now the problem:
>
> > On another page, I want to display the above with  > $item['Comment']['text']; ?> .
>
> > It shows as:
>
> > - abc - cde
>
> > The two strings are only separated by a space, so obviously the two
> > returns do not show.
>
> > In PHP (before cake), I would solve this by doing:
>
> > echo << > $item['Comments']['text']
> > END;This works? Did you try it in your view?
>
>
>
> > That would print both the strings and the returns. How can I achieve
> > the same result in cake? Thx!
> 
> -- 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: ajax autoComplete example

2006-11-27 Thread Christoph

> Christoph a scris:
> > Except I tried that.  I've even tried following the bakery article that
> > is based on that.  But nothing I do seems to get it to work.  See my
> > post here:
> > http://groups.google.com/group/cake-php/browse_frm/thread/ea0519608cc51b74/?hl=en#
> > that still hasn't been replied to... :(  Autocomplete seems incredibly
> > difficult to me...

mirceade wrote:
> Ha, ha. I HAVE FOUND IT Christoph (had the same problem). You must
> include the model you are using in the autocompletion in the controller
> code like this:
> var $uses = array('Category');
> where Category is the model you are autocompleting from. The rest is
> like in the tutorial.

Nope, that isn't what's wrong.  At least not for me.  Because the field
I'm trying to set up autocomplete for is a field that is part of the
model for the controller I'm using.

*sigh*

I've tried everything I can possible think of to try to get it to work
but it just won't.  And I know Ajax is working.  I have it working
(finally) with my pagination.  Just not the autocomplete... :(

thnx,
Christoph


--~--~-~--~~~---~--~~
 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 problems

2006-11-27 Thread jmassi

SOLVED

Finally i found the mistake.

For some reason I have comented a line in session.php cake's libs
folder and I didn't remeber until now that I decided to look line by
line this script.


Thanks for your time and responses.


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Pablo Viojo
Mariano,

I'n not asking about Active Record Pattern but Active Resource as presented
by David Heinemeier  at the RailsConf. More information can be found at
[1],[2] and [3]

Regards,

-- 
Pablo Viojo
[EMAIL PROTECTED]
http://pviojo.net

[1] http://tom.counsell.org/view/EarlyExperiencesWithActiveResource
[2] http://www.loudthinking.com/arc/000593.html
[3] http://www.loudthinking.com/lt-files/worldofresources.pdf


On 11/27/06, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
>  He meant Active Record Pattern:
>
>
>
> http://en.wikipedia.org/wiki/Active_Record
>
> Active record is an approach to reading data from a database. A row in a
> database table or view is wrapped into a class, thus an object instance is
> tied to a single row in the database. After creation of an object, a new row
> is added to the database upon save. Any object loaded gets its information
> from the database; when an object is updated, the corresponding row in the
> database is also updated. The wrapper class implements accessor methods for
> each column in the table or view.
>
> -MI
>
>
> ---
>
> Remember, smart coders answer ten questions for every question they ask.
> So be smart, be cool, and share your knowledge.
>
> BAKE ON!
>  --
>
> *De:* cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] *En
> nombre de *Christian Winther [cwi.dk]
> *Enviado el:* Lunes, 27 de Noviembre de 2006 02:45 p.m.
> *Para:* cake-php@googlegroups.com
> *Asunto:* RE: Active Resource Implementation
>
>
>
> Can you guide me to some information regarding Active Resource Pattern –
> couldn't find anything on google looking like it
>
> >
>
>


--~--~-~--~~~---~--~~
 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: Data not saving

2006-11-27 Thread joel

Okay, well, I spent an hour "debugging" this problem, only to finally
look more closely at my address bar and realize I was still on the
development server!

Thanks anyway...  :)


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



hierarchical path

2006-11-27 Thread Gregory Stewart

Hi,

I have a table called 'categories' with id and parent_id, linking to
itself.
In my view I want to show the full path of the current category, for
example if you are in the category called 'Apple':

Groceries > Fruit > Apple

I guess I would take the current id and work my way up the hierarchie.

How would I do that? I am still trying to find my way around Cake.
Would I do this with a new method or component?
How do I access the model in my component if that's the way to go? Or
If do it with a method, can a method call itself over and over again?

Ayone has done this before? Can you give me a few pointers?

Thanks,
Greg


--~--~-~--~~~---~--~~
 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: Errant IIS Installation

2006-11-27 Thread nate

I can test on IIS5, and everything seems to work okay, but I don't have
a copy of IIS6 handy.  I contacted a guy I know at Microsoft about
getting one, so we'll see what he has to say.  In the meantime, if you
want to donate to the Foundation so we can buy it, that would be highly
awesome of you.


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



Re: DB Migrations

2006-11-27 Thread Sonic Baker
Thanks Joel.


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Mariano Iglesias
He meant Active Record Pattern:

 

 
http://en.wikipedia.org/wiki/Active_Record

Active record is an approach to reading data from a database. A row in a
database table or view is wrapped into a class, thus an object instance is
tied to a single row in the database. After creation of an object, a new row
is added to the database upon save. Any object loaded gets its information
from the database; when an object is updated, the corresponding row in the
database is also updated. The wrapper class implements accessor methods for
each column in the table or view.

-MI

---

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

BAKE ON!

  _  

De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Christian Winther [cwi.dk]
Enviado el: Lunes, 27 de Noviembre de 2006 02:45 p.m.
Para: cake-php@googlegroups.com
Asunto: RE: Active Resource Implementation

 

Can you guide me to some information regarding Active Resource Pattern -
couldn't find anything on google looking like it




--~--~-~--~~~---~--~~
 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: Convert all files de UTF-8

2006-11-27 Thread francky06l

This editor allow you to save UTF-* with or without BOM :
http://www.wolosoft.com/en/superedi/

On Nov 24, 5:34 pm, "AD7six" <[EMAIL PROTECTED]> wrote:
> Hi Maxmil,
>
> http://groups-beta.google.com/group/cake-php/browse_frm/thread/28f129...
>
> errors that say "output started ... .php:1" almost certainly mean you
> have BOMs in your files (the ones it is saying started output).
>
> You don't need to change any cake files, you just need to save any file
> that contains UTF-8 characters (it's easier to just save all of them)
> UTF-8 encoded BUT, without BOMs - which means don't do it with
> notepad ;). I found this script a while ago, I don't remember the
> source/authorhttp://bin.cakephp.org/view/1526549460
>
> HTH,
>
> AD7six
> Please note:
> The manual/bakery is a good place to start any quest for info.
> The cake search (at the time of writing) erroneously reports less/no
> results for the google group.
> The wiki may contain incorrect info - read at your own risk (it's
> mainly user submitted) :)
> You may get your answer quicker by asking on the IRC Channel (you can
> access it with just a browser here:http://irc.cakephp.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: How do I use 'offset' instead of 'page' in FindAll query?

2006-11-27 Thread Mariano Iglesias

That's why if you look at it I'm calling the ceil() function.

-MI

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Lunes, 27 de Noviembre de 2006 06:10 a.m.
Para: Cake PHP
Asunto: Re: How do I use 'offset' instead of 'page' in FindAll query?

Mariano Iglesias wrote:
> Thus,
>
> $offset = 20;
> $limit = 10;
>
> $this->Model->findAll($conditions, $fields, $order, $limit, ceil(1 +
> $offset/$limit));
>
> Just wanted to look smart
>
> -MI

Your example only works if the result of $offset/$limit is an integer.
You need to take the rounding function out.


--~--~-~--~~~---~--~~
 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: Active Resource Implementation

2006-11-27 Thread Christian Winther [cwi.dk]
Can you guide me to some information regarding Active Resource Pattern –
couldn’t find anything on google looking like it

 

From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Felix Geisendörfer
Sent: 27. november 2006 17:25
To: cake-php@googlegroups.com
Subject: Re: Active Resource Implementation

 

Afaik, this is something is planned for CakePHP 1.2. Right now it's still in
it's early phase, meaning the Datasource/Model object are undergoing some
major refactoring in order to make them more generic.

-- Felix Geisendörfer aka the_undefined

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



Pablo Viojo wrote: 

Hi all,

Are there any plans about implementing the Active Resource Pattern for
Cake?. I've searched the group index and trac but haven't found anything
about it.

Regards,

-- 
Pablo Viojo 
[EMAIL PROTECTED]
http://pviojo.net 



 



--~--~-~--~~~---~--~~
 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 'offset' instead of 'page' in FindAll query?

2006-11-27 Thread nate

Well yeah, i'm not sure how you would deal with a fraction of a
database record...

It also assumes that $offset is evenly divisible by $limit.


--~--~-~--~~~---~--~~
 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: Does cake protect against SQL hacks automatically?

2006-11-27 Thread Larry E. Masters aka PhpNut
Cake handles it automatically


-- 
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access  public
*/


--~--~-~--~~~---~--~~
 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: Data not saving

2006-11-27 Thread John David Anderson (_psychic_)


On Nov 27, 2006, at 9:51 AM, joel wrote:

>
> So, the strangest thing is happening, and I don't know what else to  
> do.
>  On my development server, I am able to submit a form, and it's saving
> to the database.  But when I deploy it to the production server, it
> does everything as though it DID save the data, but it actually
> doesn't.  I mean, it's connecting to the database properly, it's not
> returning any errors, with DEBUG set at 2 I can see the queries it's
> "supposedly" executing, but there's no data populated in the database.
>
> Does anyone have any idea how I can troubleshoot this further?  The
> database schema on the development and production server is exactly  
> the
> same, so I don't know why it's doing this.

Is the production app still pointed at the development DB?

-- 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
-~--~~~~--~~--~--~---



Data not saving

2006-11-27 Thread joel

So, the strangest thing is happening, and I don't know what else to do.
 On my development server, I am able to submit a form, and it's saving
to the database.  But when I deploy it to the production server, it
does everything as though it DID save the data, but it actually
doesn't.  I mean, it's connecting to the database properly, it's not
returning any errors, with DEBUG set at 2 I can see the queries it's
"supposedly" executing, but there's no data populated in the database.

Does anyone have any idea how I can troubleshoot this further?  The
database schema on the development and production server is exactly the
same, so I don't know why it's doing this.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Does cake protect against SQL hacks automatically?

2006-11-27 Thread [EMAIL PROTECTED]

Hi,

Does cake protect against things like SQL Injection hacks
automatically, or should I still call addslashes, nl2br, and
mysql_real_escape.. on all data going through $this->Model->save


Thanks

Guy


--~--~-~--~~~---~--~~
 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 echo [returns] in cake

2006-11-27 Thread John David Anderson (_psychic_)


On Nov 27, 2006, at 9:34 AM, gabordemeter wrote:

>
> Hi! I'll give an example to illustrate my problem:
>
> I have a form which, among other fields, contains a textarea.
>
> In the textarea area I write the following:
>
> - abc
>
> - cde
>
>
> Basically I first write the string "- abc", then I hit [return] twice
> and then write the string "- cde".
>
> After I save my form, I go to phpMyAdmin and view the respective
> record. It correctly shows "- abc" on the first row, then there's a
> blank row (due to the two returns i inserted) and then, on the third
> row it shows the string "- cde".
>
> So far so good. And now the problem:
>
> On another page, I want to display the above with  $item['Comment']['text']; ?> .
>
> It shows as:
>
> - abc - cde
>
>
> The two strings are only separated by a space, so obviously the two
> returns do not show.
>
> In PHP (before cake), I would solve this by doing:
>
> echo << $item['Comments']['text']
> END;

This works? Did you try it in your view?

>
> That would print both the strings and the returns. How can I achieve
> the same result in cake? Thx!



-- 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
-~--~~~~--~~--~--~---



how to echo [returns] in cake

2006-11-27 Thread gabordemeter

Hi! I'll give an example to illustrate my problem:

I have a form which, among other fields, contains a textarea.

In the textarea area I write the following:

- abc

- cde


Basically I first write the string "- abc", then I hit [return] twice
and then write the string "- cde".

After I save my form, I go to phpMyAdmin and view the respective
record. It correctly shows "- abc" on the first row, then there's a
blank row (due to the two returns i inserted) and then, on the third
row it shows the string "- cde".

So far so good. And now the problem:

On another page, I want to display the above with  .

It shows as:

- abc - cde


The two strings are only separated by a space, so obviously the two
returns do not show.

In PHP (before cake), I would solve this by doing:

echo <

Re: Session problems

2006-11-27 Thread jmassi

Thanks for the responses,

PHP sessions are working fine I have made a test and everithing its ok.

The code for the test is:
--- session1.php

--- session2.php



I've also tried to put CAKE_SESSION_SAVE in cake mode but still not
working.

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
-~--~~~~--~~--~--~---