Re: hasMany relationship

2008-06-10 Thread [EMAIL PROTECTED]

hi

I think what you want to do is 'filter' out Users based on a condition
on the Comment field, is that correct ?

Like retrieve only users that have a comment WHERE title = 'More on
Gwoo'

if so I think you have to resort to temporarily binding a hasOne
relationship to the User Model like so :

this->User->bindModel(
array('hasOne' =>
array('CommentFilter' =>
array(

'className' => 'Comment',

'conditions' => array('title' => 'More on Gwoo')

)
)
)
);

then use the CommentFilter association in the 'find' call

$this->User->find('all',array('conditions' =>
array('CommentFilter.title' => 'More on Gwoo')));

I think it does the trick but I'd like to stand corrected if I'm
wrong.

What I don't know how to do is how to filter with multiple conditions
like :

Comment.title = 'More on Gwoo' OR  Comment.title = 'On Gwoo the
Kungwoo'

since the hasOne assocation will only (hum ...) associate one record
that we can then filter on. Anyone on this one ?

What I often do is use Set::extract (with the Xpath syntax) to filter
my result sets.

If you just want to omit some records from the associated results you
can use the containable behavior and do something like this :

$this->User->contain('Comment' => array('conditions'
=>array( 'Comment.title' => 'More on Gwoo')));

a find('all') will give you all users but will have filtered the
Comments

I hope I'm right in all I'm saying, this all seems to work for me.

hth

thomas


On Jun 10, 10:45 am, teum <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a problem with the hasMany relationship. Let's take the example
> given by the cookbook : a User hasMany Comments.
>
> //Sample results from a $this->User->find() call.
>
> Array
> (
>     [User] => Array
>         (
>             [id] => 121
>             [name] => Gwoo the Kungwoo
>             [created] => 2007-05-01 10:31:01
>         )
>     [Comment] => Array
>         (
>             [0] => Array
>                 (
>                     [id] => 123
>                     [user_id] => 121
>                     [title] => On Gwoo the Kungwoo
>                     [body] => The Kungwooness is not so Gwooish
>                     [created] => 2006-05-01 10:31:01
>                 )
>             [1] => Array
>                 (
>                     [id] => 123
>                     [user_id] => 121
>                     [title] => More on Gwoo
>                     [body] => But what of the ‘Nut?
>                     [created] => 2006-05-01 10:41:01
>                 )
>         )
> )
>
> The find() call will result in two separate queries (tell me if I'm
> wrong but this is what I can see in my program) so how to specify a
> condition related to a field of the comments table using the find()
> method ?
>
> If it is not clear enough I can reformulate :)
>
> Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Help Me Please

2008-06-10 Thread Joel Perras


On Jun 6, 1:14 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> That's not going to work. In fact, if you figured out a way to get
> Cake to make it work, I'd file a ticket to say that it was a bug, not
> a feature.
>
> A "join table" should have only fields which are foreign keys to other
> tables. Its sole purpose is to join records between 2 or more tables,
> nothing else.

I beg to differ.  From Mariano's own blog:  http://tinyurl.com/4kbe9q
In Cake 1.2, extra fields in the join models are easy to integrate
into your application.

There are plenty of situations where additional information in the
join table is useful, the simplest being the date/time that the join
record was created, such as in the prototypical articles_tags example;
sometimes it is useful to know when a particular article was
associated with a particular tag, or vice versa.  Other examples could
include an online shopping system, where you would have products,
carts, and carts_products (taken from an old thread on this group).
The logical location to indicate the quantity of a product in a cart
would be in the carts_products join table.

-Joel.

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



Containable Behavior and HABTM

2008-06-10 Thread dizz

Hello I am trying to use the containable behavior in a category
controller that habtm posts. In the view action of the category
controller I am trying to display all posts for the category and also
all of the posts categories.

Here is what I am trying to use:

$this->Category->contain(array('Post' => array('User.name',
'Category')));

But I still cannot get the categories for the post.

If I do something like the following in the category view action I do
get the categories for the post but I also get all the posts and not
just the ones tied to the category:

$this->Category->Post->contain(array('User.name', 'Category.name'));
pr($this->Category->Post->findAll());

Any help would be greatly appreciated.
Thanks

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



Re: Help Me Please

2008-06-10 Thread dealbest

:) Hey... I've find a way to include extra data in a join table...
What I'm doing is to manipulate many tables at once...I mean I simple
need to create a function in a controller... My controller can use
more than one model... So I obtain...

Here's the code
 function add()
{
if (!empty($this->data))
{
//We can save the Post data:
//it should be in $this->data['Post']

$this->set('members', $this->Member->save($this->data));
  $this->set('addresses', $this->Address->save($this->data));


//Now, we'll need to save the Comment data
//But first, we need to know the ID for the
//Post we just saved...

$member_id = $this->Member->getLastInsertId();



//Now we add this information to the save data
//and save the comment.

$this->data['Memberrole']['member_id'] = $member_id;
 $this->data['Contact']['member_id'] = $member_id;

//Because our Post hasMany Comments, we can access
//the Comment model through the Post model:
 $this->set('contacts', $this->Contact->save($this-
>data));

$this->set('memberroles', $this->Memberrole->save($this-
>data));


  $contact_id = $this->Contact->getLastInsertId();
  $address_id = $this->Address->getLastInsertId();

   $this->data['Contactaddress']['contact_id'] = $contact_id;
 $this->data['Contactaddress']['address_id'] = $address_id;

$this->set('contactaddresseses', $this->Contactaddress-
>save($this->data));

}
 }

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



Re: Entry data with a . "dot" sign

2008-06-10 Thread Grant Cox

There is no such limit in Cake by default, it'll be in your
application code.

Are you sure that the model is passing validation?  If you have the
"alphaNumeric" validation rule, it'll fail on a period, as it
explicitly only allows alphabetic and numeric chars.  What is the SQL
being generated?

Please post your relevant model and controller action if you require
further assistance.


On Jun 11, 2:50 pm, Reza Muhammad <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I just noticed that by default Cake wouldn't save data where a . (dot)
> is present.  For example, I tried to add a new username that is
> "firstname.lastname", and Cake said that the user was added
> successfully, but it wasn't added at all.
>
> What do I need to add so that Cake can accept this type of special
> character? Is sanitize part of it?
>
> Thank you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Entry data with a . "dot" sign

2008-06-10 Thread Reza Muhammad

Hi all,

I just noticed that by default Cake wouldn't save data where a . (dot)  
is present.  For example, I tried to add a new username that is  
"firstname.lastname", and Cake said that the user was added  
successfully, but it wasn't added at all.

What do I need to add so that Cake can accept this type of special  
character? Is sanitize part of it?

Thank you.


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



Re: Baking controllers, Missing table for 'Item'

2008-06-10 Thread David Christopher Zentgraf

Okay, sorry, please ignore. There _was_ an 'item' relationship which  
shouldn't have been there.
Better go get some lunch... ;o)

On 11 Jun 2008, at 13:16, David Christopher Zentgraf wrote:

> Hi,
>
> I'm trying to bake my controllers via the console. My app and Cake  
> directories are separated, the Cake folder is in /path/to/trunk/cake/ 
> cake, my app in /path/to/trunk/shop/admin.
>
> From /path/to/trunk/cake/cake/console I do this:
>
> $ ./cake -app /path/to/trunk/shop/admin
> ...
> ---
> App : admin
> Path: /path/to/trunk/shop/admin
> ...
> ---
> Bake Controller
> Path: /path/to/trunk/shop/admin/controllers/
> ...
> ---
> Baking ProductsController
> ---
> ...
>
> After all questions are answered, I get this error:
> "Error: Missing database table 'items' for model 'Item'"
>
> Baking the database config and the models from it worked fine.
> There's no model or field in my app called "item".
> Trying this on the latest svn checkout 1.2.0.7165.
> Could this be my fault or is it a Cake bug?
>


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



Run bake.php on Linux

2008-06-10 Thread Marcos Aruj
Hi all,

How can I run bake.php on Ubuntu Linux. I installed php5-cli via apt-get,
but can't find the proper command to run it.
Any ideas?

Thanks,

Marcos

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



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Dr. Tarique Sani

On Jun 11, 3:01 am, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
> I wasn't sure but that's great to know. It's be great to see a model
> behavior for this that would automatically create lucene documents for
> every record and then maybe a search method that would allow records
> to be retrieved. actsAs Lucene would be very nice. (and if you have
> such a thing already, I'd love to see it :) )

I have used Zend_Search _Lucene with cakePHP and it works great - but
I never figured out how to paginate the search results from Lucene

I have been toying with a actsAs FULLTEXT behavior

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



Baking controllers, Missing table for 'Item'

2008-06-10 Thread David Christopher Zentgraf

Hi,

I'm trying to bake my controllers via the console. My app and Cake  
directories are separated, the Cake folder is in /path/to/trunk/cake/ 
cake, my app in /path/to/trunk/shop/admin.

 From /path/to/trunk/cake/cake/console I do this:

$ ./cake -app /path/to/trunk/shop/admin
...
---
App : admin
Path: /path/to/trunk/shop/admin
...
---
Bake Controller
Path: /path/to/trunk/shop/admin/controllers/
...
---
Baking ProductsController
---
...

After all questions are answered, I get this error:
"Error: Missing database table 'items' for model 'Item'"

Baking the database config and the models from it worked fine.
There's no model or field in my app called "item".
Trying this on the latest svn checkout 1.2.0.7165.
Could this be my fault or is it a Cake bug?


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



Re: Ajax Autocomplete is not working !

2008-06-10 Thread MMatchan

Clement, Thanks a million. I made the path relative and removed the
echo 'in the loop' and voila!

Appreciate it

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



Re: Any Montreal cakePHP developpers?

2008-06-10 Thread Joel Perras

Hey Ed, I live and breathe in this wonderful city.  Hit me up if ever
you feel like having a micro-cakefest one day ;-).  My email is
publicly available on my profile.

-Joel.

On Jun 10, 2:33 pm, Sake <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Any cakePHP developpers living in montreal? I'd like to get some
> experience working with others in cakePHP and I have some ideas that
> I'd like to meet with someone to develop, I'm curious if anybody on
> this list is living in the city.
>
> Let me know!
>
> -Ed
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/basics.php, line 528]

2008-06-10 Thread Action

resolved. ignore.

On Jun 10, 9:18 pm, Action <[EMAIL PROTECTED]> wrote:
> Correction: I get those errors in EVERY save operation (adding
> comments, editing posts, etc).
>
> On Jun 10, 9:07 pm, Action <[EMAIL PROTECTED]> wrote:
>
> > In /posts/add, I'm saving a new post as well as all associated tags
> > with it (posts habtm tags). In 1.2 Beta, it worked fined, but in 1.2
> > RC1, I get these warnings:
>
> > Warning (2): array_merge() [function.array-merge]: Argument #1 is not
> > an array [CORE/cake/basics.php, line 528]
> > Warning (2): array_merge() [function.array-merge]: Argument #2 is not
> > an array [CORE/cake/basics.php, line 528]
> > Warning (2): Invalid argument supplied for foreach() [CORE/cake/
> > basics.php, line 534]
>
> > The post and tags still save, I just now get warnings. Here is my
> > code:
>
> > function add()
>
> > {
>
> > $this->pageTitle = 'Create Post';
>
> > if(!empty($this->data)) {
>
> > $this->Post->create();
>
> > $tags = explode(' ', 
> > trim($this->data['Tag']['name']));
>
> > foreach($tags as $tag) {
>
> > $this->Post->Tag->create(array('name' => 
> > $tag));
>
> > $current_tag = $this->Tag->findByName($tag);
>
> > if(is_array($current_tag)) {
>
> > $this->data['Tag']['Tag'][] = 
> > $current_tag['Tag']['id'];
>
> > } else {
>
> > $this->Post->Tag->save();
>
> > $this->data['Tag']['Tag'][] = 
> > $this->Post->Tag->id;
>
> > }
>
> > }
>
> > $this->Post->save($this->data);
>
> > $this->Session->setFlash('Your post has been 
> > created.', $layout =
> > 'flash_success');
>
> > $this->redirect(array('action'=>'index'));
>
> > }
>
> > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/basics.php, line 528]

2008-06-10 Thread Action

Correction: I get those errors in EVERY save operation (adding
comments, editing posts, etc).

On Jun 10, 9:07 pm, Action <[EMAIL PROTECTED]> wrote:
> In /posts/add, I'm saving a new post as well as all associated tags
> with it (posts habtm tags). In 1.2 Beta, it worked fined, but in 1.2
> RC1, I get these warnings:
>
> Warning (2): array_merge() [function.array-merge]: Argument #1 is not
> an array [CORE/cake/basics.php, line 528]
> Warning (2): array_merge() [function.array-merge]: Argument #2 is not
> an array [CORE/cake/basics.php, line 528]
> Warning (2): Invalid argument supplied for foreach() [CORE/cake/
> basics.php, line 534]
>
> The post and tags still save, I just now get warnings. Here is my
> code:
>
> function add()
>
> {
>
> $this->pageTitle = 'Create Post';
>
> if(!empty($this->data)) {
>
> $this->Post->create();
>
> $tags = explode(' ', 
> trim($this->data['Tag']['name']));
>
> foreach($tags as $tag) {
>
> $this->Post->Tag->create(array('name' => 
> $tag));
>
> $current_tag = $this->Tag->findByName($tag);
>
> if(is_array($current_tag)) {
>
> $this->data['Tag']['Tag'][] = 
> $current_tag['Tag']['id'];
>
> } else {
>
> $this->Post->Tag->save();
>
> $this->data['Tag']['Tag'][] = 
> $this->Post->Tag->id;
>
> }
>
> }
>
> $this->Post->save($this->data);
>
> $this->Session->setFlash('Your post has been 
> created.', $layout =
> 'flash_success');
>
> $this->redirect(array('action'=>'index'));
>
> }
>
> }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE/cake/basics.php, line 528]

2008-06-10 Thread Action

In /posts/add, I'm saving a new post as well as all associated tags
with it (posts habtm tags). In 1.2 Beta, it worked fined, but in 1.2
RC1, I get these warnings:

Warning (2): array_merge() [function.array-merge]: Argument #1 is not
an array [CORE/cake/basics.php, line 528]
Warning (2): array_merge() [function.array-merge]: Argument #2 is not
an array [CORE/cake/basics.php, line 528]
Warning (2): Invalid argument supplied for foreach() [CORE/cake/
basics.php, line 534]

The post and tags still save, I just now get warnings. Here is my
code:

function add()

{

$this->pageTitle = 'Create Post';

if(!empty($this->data)) {

$this->Post->create();

$tags = explode(' ', trim($this->data['Tag']['name']));

foreach($tags as $tag) {

$this->Post->Tag->create(array('name' => $tag));

$current_tag = $this->Tag->findByName($tag);

if(is_array($current_tag)) {

$this->data['Tag']['Tag'][] = 
$current_tag['Tag']['id'];

} else {

$this->Post->Tag->save();

$this->data['Tag']['Tag'][] = 
$this->Post->Tag->id;

}

}

$this->Post->save($this->data);

$this->Session->setFlash('Your post has been created.', 
$layout =
'flash_success');

$this->redirect(array('action'=>'index'));

}

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



Re: Tools for merging directories

2008-06-10 Thread Grant Cox

Ahh.  I saw the "kind is folder", but I didn't know about "none of the
following is true".  Good stuff :)


On Jun 7, 1:58 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> On 6 Jun 2008, at 09:57,GrantCoxwrote:
>
> > How do you list "all files" in spotlight?
>
> Okay, wow, that was indeed surprisingly non-straight forward.
> As I don't want to start an OS flamewar here, I'll just list the
> facts: ;o)
>
> Open the Cake folder.
> Hit Cmd+F to initiate a Search.
> Make sure the Cake folder is selected in the "Search:" bar.
> Hold the Option key and click on the '+' to add a condition (adds a
> condition group).
> Select "[None] of the following are true" for the group condition.
> Select "[Kind] is [Folders]" for the condition.
>
> Here's a screenshot:http://skitch.com/deceze/prr5/spotlight
>
> This applies to 10.5 Leopard, not sure if Condition Groups already
> existed in 10.4.
>
> The .svn information should survive, since the Finder generally hides
> all "dot files".
> Once that's done, exploding a tar on top of the remaining folder
> structure via the command line should be simple.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: from layout template ... determine if content_for_page is scaffold output?

2008-06-10 Thread Dardo Sordi Bogado

Put this in the layout:



Regards,
- Dardo.


On Tue, Jun 10, 2008 at 9:09 PM, aranworld <[EMAIL PROTECTED]> wrote:
>
> Is there an easy way to determine from the layout page if the page
> content being rendered is a scaffolding template?
>
> I want to dynamically load a scaffolding specific stylesheet on the
> condition that the rendered view is a scaffolding.
>
>
> >
>

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



Re: Testing custom model methods that are using model associations

2008-06-10 Thread Grant Cox

I must admit I don't really get the point of using mock models in your
tests - sure it's best for your tests to be testing just the model in
question, but creating a whole swag of mock objects just creates
another layer that can have bugs in it.  I want to test my application
code - not mock code that emulates the application...

Anyway, my point is that I just test the application models directly.
The only problem with this of course is that you don't want the test
cases mucking around in your real database - so I have defined a app/
config/database.test.php with the same database connection names, just
to a test database server.  I require this in the app/webroot/test.php
(before the normal database file is loaded), and just have appropriate
"if ( !class_exists('DATABASE_CONFIG') ){" in both files - this way
the real database just isn't defined in test modes, but all the
application models are unchanged.

Maybe I should have a chat to the devs on IRC, and write this up on
Bakery if they approve.


On Jun 10, 11:56 pm, strangy <[EMAIL PROTECTED]> wrote:
> What is the preferred way of testing associations/relations in custom
> model methods?
> When testing a model I make a test model class that inherits from the
> original model class. I use $this->name in all my custom model methods
> when I need to get the model name for the conditions. Now if I use
> associations in those methods i don't know how to test them. Do I need
> to redefine the $hasMany, $hasManyAndBelongsTo & $belongsTo in my test
> model or is there another way.
>
> What do you think about it?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



from layout template ... determine if content_for_page is scaffold output?

2008-06-10 Thread aranworld

Is there an easy way to determine from the layout page if the page
content being rendered is a scaffolding template?

I want to dynamically load a scaffolding specific stylesheet on the
condition that the rendered view is a scaffolding.


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



Re: Blank Login Page

2008-06-10 Thread Arak Tai'Roth

No I didn't, but I just did. And it works fine. Therefore it has to be
the admin routing. But I thought that was one line that needed to be
commented out, and I did just that. The line is included in the code
at the top of all of this.

On Jun 10, 3:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
> Did you try to redirect to another controller/action not in admin
> route ?
>
> On Jun 10, 8:38 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
>
> > Apparently it posted the second message I sent and not the first one,
> > so here is the first one over again.
>
> > @Sam
> >  I did what you asked, and it does indeed add the messages to the
> > error log in every function, including the admin_index function, but I
> > don't know how this helps me
>
> > @francky061
> >  It does redirect properly tohttp://mypage.com/admin/news.
> > However it doesn't actually display anything except the debug MySQL
> > data. Which amusingly enough doesn't have the query in it that I sent
> > it from the admin_index function
>
> > @filip
> >  I did try doing that, also tried echoing a string in the
> > admin_index function of the news controller. However nothing gets
> > outputted. Which, when combined with what I said to francky, leads me
> > to believe it isn't hitting the admin_index function, but I have no
> > idea why
>
> > On Jun 10, 8:51 am, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
>
> > > Well, I do appreciate the help, and would love it if someone was able
> > > to fix this problem anyways for me. I think I might just switch to
> > > auth, I originally didn't use auth because I thought it was going to
> > > be more work, clearly that is no longer the case as I could have been
> > > done this had I used auth a long time ago. But if you still feel like
> > > tackling the problem I am here.
>
> > > On Jun 10, 2:35 am, Filip Camerman <[EMAIL PROTECTED]> wrote:
>
> > > > On my current dev machine CakePHP gives me a completelyblankpage
> > > > without any indication of what went wrong whenever my view uses a non-
> > > > defined variable. So replace your view with one that just says "hello"
> > > > for a second and see if that gets printed; if so you know the prob.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ownership based authorization

2008-06-10 Thread Alan Gibson

Thanks for the tip. I read through some stuff on Cake's ACLs before,
but never really picked up on the possibilities for row level security
because most tutorials focus on action level restriction.

After some more reading, it looks like what I need is to use Model.id
style aros and acos along with AuthComponent in crud mode. I found
this article helpful: 
http://bakery.cakephp.org/articles/view/how-to-use-acl-in-1-2-x

On Jun 3, 7:25 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> PS: And I forgot, have a look at the ACL Behavior.
>
> On Tue, Jun 3, 2008 at 11:18 PM, Dardo Sordi Bogado
>
> <[EMAIL PROTECTED]> wrote:
> >> What I mean by 'ownership based' is that authorization is based on
> >> object relationships in the database, not on ACLs which consider URLs
> >> or controller actions.
>
> > That is one mode of operation of the Auth component, there are others
> > you might want to readhttp://book.cakephp.org/view/396/authorize.
>
> > Also ACLs can be used separated from the Auth component and are a good
> > fit for doing what you are saying.
>
> > Regards,
> > - Dardo Sordi.

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



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Alain Veylit

Same here - 'd like to keep informed of your progress,
Alain

Jonathan Snook wrote:
> On Tue, Jun 10, 2008 at 3:21 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:
>   
>> I don't think that a cake implementation is needed Zend_Search_Lucene
>> is awesome, and it doesn't have any dependencies from Zend Framework.
>> 
>
> I wasn't sure but that's great to know. It's be great to see a model
> behavior for this that would automatically create lucene documents for
> every record and then maybe a search method that would allow records
> to be retrieved. actsAs Lucene would be very nice. (and if you have
> such a thing already, I'd love to see it :) )
>
> >
>
>   


-- 
Alain Veylit
Application developer
Claremont Colleges Digital Library
The Libraries of the Claremont Colleges
Claremont University Consortium
909-621-8013


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



Re: problem with api.cakephp.org

2008-06-10 Thread Marcin Domanski

debug using firebug lite i think or whatever tools one can use and
submit a patch @ trac

On Wed, Jun 11, 2008 at 12:32 AM, . <[EMAIL PROTECTED]> wrote:
> i wanted the site to be as compatible as possible with ALL browsers,
> including IE6, so that is why I want to know what is the problem
>
> On Tue, Jun 10, 2008 at 2:49 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:
>>
>> ok, don't want to be harsh but c'mon - you're a developer an you're
>> using ie6 to something beside testing  ?
>> Ie6 is the source of all evil on the internet ... why do you even care ?
>> Apple made a great move here - they said their new '.mac' (whatever
>> its called now) has a minimum of ie7 - and that is great - i hope to
>> see more of such announcements in the future... its 2008 and we should
>> all forget about retarded browsers.
>>
>> On Tue, Jun 10, 2008 at 11:28 PM, . <[EMAIL PROTECTED]> wrote:
>> > It works find in Firefox. But in IE6, I just see the cake header and a
>> > blank
>> > page. Does anyone else with IE6 see this problem? Or is this specific to
>> > my
>> > version of IE6? Wierd...
>> >
>> > On Tue, Jun 10, 2008 at 1:41 PM, . <[EMAIL PROTECTED]> wrote:
>> >>
>> >> does any one else see just a blank page in api.cakephp.org?
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Marcin Domanski
>> http://kabturek.info
>>
>>
>
>
> >
>



-- 
Marcin Domanski
http://kabturek.info

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



Baking on Windows with RC1

2008-06-10 Thread Paul R. Zwiers

Dear all,

Maybe I missed something, but after upgrading to RC1 yesterday I noticed that 
when I run "cake bake" and select the Model option I get to choose the database 
config (default) and then bake returns me to the prompt without any message. 
When I choose Controller I immediately get thrown out to the prompt.

Am I missing something in the release notes or am I having a problem? ;-)

Thanks in advance,
Paul


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



Re: problem with api.cakephp.org

2008-06-10 Thread .
i wanted the site to be as compatible as possible with ALL browsers,
including IE6, so that is why I want to know what is the problem

On Tue, Jun 10, 2008 at 2:49 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:

>
> ok, don't want to be harsh but c'mon - you're a developer an you're
> using ie6 to something beside testing  ?
> Ie6 is the source of all evil on the internet ... why do you even care ?
> Apple made a great move here - they said their new '.mac' (whatever
> its called now) has a minimum of ie7 - and that is great - i hope to
> see more of such announcements in the future... its 2008 and we should
> all forget about retarded browsers.
>
> On Tue, Jun 10, 2008 at 11:28 PM, . <[EMAIL PROTECTED]> wrote:
> > It works find in Firefox. But in IE6, I just see the cake header and a
> blank
> > page. Does anyone else with IE6 see this problem? Or is this specific to
> my
> > version of IE6? Wierd...
> >
> > On Tue, Jun 10, 2008 at 1:41 PM, . <[EMAIL PROTECTED]> wrote:
> >>
> >> does any one else see just a blank page in api.cakephp.org?
> >
> > >
> >
>
>
>
> --
> Marcin Domanski
> http://kabturek.info
>
> >
>

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



Re: javascript link newbie question

2008-06-10 Thread .
typo

i meant

array('validate.js')

and





On Tue, Jun 10, 2008 at 2:48 PM, clemos <[EMAIL PROTECTED]> wrote:

>
> Hi .
>
> Do you often link "array('commons.js')" when you actually want
> "validate.js?11645" to be loaded ???
> The weirdest thing is that Cake links "validate.js" instead...
>
> The correct code, at least on Earth and for computers built by human
> beings, should be:
> link('validate.js?11645') ?>
>
> +++
> Clément
>
> On Tue, Jun 10, 2008 at 10:44 PM, . <[EMAIL PROTECTED]> wrote:
> > when i do this:
> > echo $javascript->link(array('common.js'))
> >
> > the output i get is
> > 
> >
> > this is giving me problems in IE6 (but it is okay in firefox or IE7). The
> > correct line should be
> >
> > 
> > (without the slash '/' to the left of the 'js')
> >
> > how do i do this?
> >
> > thanks
> > >
> >
>
> >
>

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



cake install in subdirectory not going quitely into the night

2008-06-10 Thread wmshay06

We were given an application from a customer that uses
cake_1.1.18.5850.  From what we can ascertain all files are included.
We have been able to successfully build the db, edit db connection
parmaters, etc However, the application fails for a number of reasons,
including including 'Call-time pass-by-reference has been deprecated'
errors.  Short of find each such problem and correctly it, is there a
strightforward way to fix.

thanks!

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



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Jonathan Snook

On Tue, Jun 10, 2008 at 3:21 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:
> I don't think that a cake implementation is needed Zend_Search_Lucene
> is awesome, and it doesn't have any dependencies from Zend Framework.

I wasn't sure but that's great to know. It's be great to see a model
behavior for this that would automatically create lucene documents for
every record and then maybe a search method that would allow records
to be retrieved. actsAs Lucene would be very nice. (and if you have
such a thing already, I'd love to see it :) )

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



Re: javascript link newbie question

2008-06-10 Thread clemos

Hi .

Do you often link "array('commons.js')" when you actually want
"validate.js?11645" to be loaded ???
The weirdest thing is that Cake links "validate.js" instead...

The correct code, at least on Earth and for computers built by human
beings, should be:
link('validate.js?11645') ?>

+++
Clément

On Tue, Jun 10, 2008 at 10:44 PM, . <[EMAIL PROTECTED]> wrote:
> when i do this:
> echo $javascript->link(array('common.js'))
>
> the output i get is
> 
>
> this is giving me problems in IE6 (but it is okay in firefox or IE7). The
> correct line should be
>
> 
> (without the slash '/' to the left of the 'js')
>
> how do i do this?
>
> thanks
> >
>

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



Re: problem with api.cakephp.org

2008-06-10 Thread Marcin Domanski

ok, don't want to be harsh but c'mon - you're a developer an you're
using ie6 to something beside testing  ?
Ie6 is the source of all evil on the internet ... why do you even care ?
Apple made a great move here - they said their new '.mac' (whatever
its called now) has a minimum of ie7 - and that is great - i hope to
see more of such announcements in the future... its 2008 and we should
all forget about retarded browsers.

On Tue, Jun 10, 2008 at 11:28 PM, . <[EMAIL PROTECTED]> wrote:
> It works find in Firefox. But in IE6, I just see the cake header and a blank
> page. Does anyone else with IE6 see this problem? Or is this specific to my
> version of IE6? Wierd...
>
> On Tue, Jun 10, 2008 at 1:41 PM, . <[EMAIL PROTECTED]> wrote:
>>
>> does any one else see just a blank page in api.cakephp.org?
>
> >
>



-- 
Marcin Domanski
http://kabturek.info

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



problem with api.cakephp.org

2008-06-10 Thread .
does any one else see just a blank page in api.cakephp.org?

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



Re: Ajax Autocomplete is not working !

2008-06-10 Thread clemos

Hi

I think your problem is here in your view :
> autoComplete('Post/title' ,'/myapps/blog/posts/
> autoComplete');?>
The url you use looks absolute, whereas it should be, as with all Cake
helpers, relative to your app (probably : "/blog/posts/autoComplete")
You should probably remove "echo "in the loop"; as well...

By the way, creating your form will be easier with the form helper:
"create("/posts/autoComplete") ?>"

And last, but not least, for all ajax debugging, I advise you to
install Firebug (https://addons.mozilla.org/fr/firefox/addon/1843)
It would have very quickly pointed you to the fact that your ajax
request was returning a 404, and not the page you wanted.

++
Clément

On Tue, Jun 10, 2008 at 5:50 PM, MMatchan <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Im brand new to Cake and to PHP in general. Im trying to setup a
> simple Ajax Autocomplete script going.. I have a DB table called Posts
> with a bunch of names called Title.
> I just want to have a simple textbox that autocompletes and fills in
> the selected title...
>
> Im using CAKE PHP v 1.2 . My probem is that the textbox renders
> correctly but the AJAX part is not working What am I missing ? Pls
> help
>
> Here is a snippet from my controller (posts_controller.php)
>
>  function autoComplete()
>{
>echo 'in the loop';
>  //$this->set('posts',$this->Post->findAll("title LIKE '{$this-
>>data['Post']['title']}'"));
>$this->set('posts', $this->Post->findAll());
>$this->layout = 'ajax';
> }
>
>
> Here is a snippet from my view (view.thtml)
>
>
>  autoComplete('Post/title' ,'/myapps/blog/posts/
> autoComplete');?>
>
>
>
> Here is a snippet from my view (auto_complete.thml)
> 
> 
> 
> 
> 
> 
>   
>
>
>
> >
>

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



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Jonathan Snook

On Tue, Jun 10, 2008 at 3:21 PM, Marcin Domanski <[EMAIL PROTECTED]> wrote:
> I don't think that a cake implementation is needed Zend_Search_Lucene
> is awesome, and it doesn't have any dependencies from Zend Framework.

I wasn't sure but that's great to know. It's be great to see a model
behavior for this that would automatically create lucene documents for
every record and then maybe a search method that would allow records
to be retrieved. actsAs Lucene would be very nice. (and if you have
such a thing already, I'd love to see it :) )

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



Re: Blank Login Page

2008-06-10 Thread francky06l

Did you try to redirect to another controller/action not in admin
route ?

On Jun 10, 8:38 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
> Apparently it posted the second message I sent and not the first one,
> so here is the first one over again.
>
> @Sam
>  I did what you asked, and it does indeed add the messages to the
> error log in every function, including the admin_index function, but I
> don't know how this helps me
>
> @francky061
>  It does redirect properly tohttp://mypage.com/admin/news.
> However it doesn't actually display anything except the debug MySQL
> data. Which amusingly enough doesn't have the query in it that I sent
> it from the admin_index function
>
> @filip
>  I did try doing that, also tried echoing a string in the
> admin_index function of the news controller. However nothing gets
> outputted. Which, when combined with what I said to francky, leads me
> to believe it isn't hitting the admin_index function, but I have no
> idea why
>
> On Jun 10, 8:51 am, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
>
> > Well, I do appreciate the help, and would love it if someone was able
> > to fix this problem anyways for me. I think I might just switch to
> > auth, I originally didn't use auth because I thought it was going to
> > be more work, clearly that is no longer the case as I could have been
> > done this had I used auth a long time ago. But if you still feel like
> > tackling the problem I am here.
>
> > On Jun 10, 2:35 am, Filip Camerman <[EMAIL PROTECTED]> wrote:
>
> > > On my current dev machine CakePHP gives me a completelyblankpage
> > > without any indication of what went wrong whenever my view uses a non-
> > > defined variable. So replace your view with one that just says "hello"
> > > for a second and see if that gets printed; if so you know the prob.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Ajax Autocomplete is not working !

2008-06-10 Thread clemos

Actually, the top best definitive line would be :
autoComplete('Post.title' ,'/posts/autoComplete');?>
CakePHP 1.2 prefers "Model.field" over the old "Model/field" way.

+++
Clément

On Tue, Jun 10, 2008 at 10:27 PM, clemos <[EMAIL PROTECTED]> wrote:
> Hi
>
> I think your problem is here in your view :
>> autoComplete('Post/title' ,'/myapps/blog/posts/
>> autoComplete');?>
> The url you use looks absolute, whereas it should be, as with all Cake
> helpers, relative to your app (probably : "/blog/posts/autoComplete")
> You should probably remove "echo "in the loop"; as well...
>
> By the way, creating your form will be easier with the form helper:
> "create("/posts/autoComplete") ?>"
>
> And last, but not least, for all ajax debugging, I advise you to
> install Firebug (https://addons.mozilla.org/fr/firefox/addon/1843)
> It would have very quickly pointed you to the fact that your ajax
> request was returning a 404, and not the page you wanted.
>
> ++
> Clément
>
> On Tue, Jun 10, 2008 at 5:50 PM, MMatchan <[EMAIL PROTECTED]> wrote:
>>
>> Hi all,
>>
>> Im brand new to Cake and to PHP in general. Im trying to setup a
>> simple Ajax Autocomplete script going.. I have a DB table called Posts
>> with a bunch of names called Title.
>> I just want to have a simple textbox that autocompletes and fills in
>> the selected title...
>>
>> Im using CAKE PHP v 1.2 . My probem is that the textbox renders
>> correctly but the AJAX part is not working What am I missing ? Pls
>> help
>>
>> Here is a snippet from my controller (posts_controller.php)
>>
>>  function autoComplete()
>>{
>>echo 'in the loop';
>>  //$this->set('posts',$this->Post->findAll("title LIKE '{$this-
>>>data['Post']['title']}'"));
>>$this->set('posts', $this->Post->findAll());
>>$this->layout = 'ajax';
>> }
>>
>>
>> Here is a snippet from my view (view.thtml)
>>
>>
>>  autoComplete('Post/title' ,'/myapps/blog/posts/
>> autoComplete');?>
>>
>>
>>
>> Here is a snippet from my view (auto_complete.thml)
>> 
>> 
>> 
>> 
>> 
>> 
>>   
>>
>>
>>
>> >>
>>
>

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



Re: problem with api.cakephp.org

2008-06-10 Thread .
It works find in Firefox. But in IE6, I just see the cake header and a blank
page. Does anyone else with IE6 see this problem? Or is this specific to my
version of IE6? Wierd...

On Tue, Jun 10, 2008 at 1:41 PM, . <[EMAIL PROTECTED]> wrote:

> does any one else see just a blank page in api.cakephp.org?

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



javascript link newbie question

2008-06-10 Thread .
when i do this:
echo $javascript->link(array('common.js'))

the output i get is


this is giving me problems in IE6 (but it is okay in firefox or IE7). The
correct line should be


(without the slash '/' to the left of the 'js')

how do i do this?

thanks

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



Re: multi language for database tables

2008-06-10 Thread Dardo Sordi Bogado

Check the i18n behavior.

On Tue, Jun 10, 2008 at 3:54 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> hi,
> we're building a cakephp application where we need (beside normal l10n
> functionality for static site texts) the possibility to store and
> display database fields according to users language
>
> E.g. customers should be able to store their shipping terms in several
> languages. According to wich language a site user is logged in these
> terms should be displayed.
>
> Because we don't know how many languages a user needs I thought about
> creating a language table to every table that holds user texts. The
> normal table always only holds the base language.
>
> So let's say theres the user table 'userdata' with fields
>
> id
> name
> address
> shipping_terms
>
> and the language table 'userdata_lng' with
>
> id (same id as in base table)
> language (language code)
> shipping_terms (translated text)
>
> So how do I make my application with least programmming effort to
> store and display the fields according to user language?
>
> We thought about putting the logic into the model to be able to use
> normal save/retrieve controller methods but that would mean to
> overwrite every single retrieve/save method right?
>
> Is there mayba a simpler or more elegant solution to the problem? ;)
>
> Thanks in advance!
>
> Cheers
> Ralf
>
> >
>

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



Re: 503 5.5.2 Send hello first (email component)

2008-06-10 Thread ianmcn

While waiting for replys to this, I tried using the Pear mail script
as a Vendor and got it working within about 30 seconds! Thanks for the
replies, they have confirmed that it's probably best for now to stick
with a more mature mail system.

On Jun 10, 3:09 pm, BrendonKoz <[EMAIL PROTECTED]> wrote:
> You could also use the Zend framework's email classes as a vendor if
> need be.  Before the Cake email component was created, that was what
> my original plan was for sending email.  There are plenty of tutorials
> on using the Zend Framework's email class.  (Don't think of the Zend
> Framework as a competitor if you've already chosen Cake.  Cake is a
> full stack framework, Zend is a skeletal framework, you can and should
> use it where and when you can.)
>
> On Jun 10, 9:46 am, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
>
> > > I am trying to use the new email component in cake 1.2, but am having
> > > problems using it with an authenticated SMTP server. I am getting the
> > > following error:
> > > 503 5.5.2 Send hello first
>
> > Not to knock the core developers but the email component still needs
> > some work, especially in support for SMTP extensions like AUTH. My
> > recommendation would be to use SwiftMailer (there are CakePHP
> > components which a google search is likely to uncover but I'm too lazy
> > to do myself).

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



Re: How i do date validation?

2008-06-10 Thread GreyWolf

I told you i already read the documentation and still isnt working.

'data_create' => array( 'rule' => 'date',
 'message' => 'Enter a valid date in 
YY-MM-DD format.',
 'allowEmpty' => false
 ),

The script returns the 'Enter a valid date in YY-MM-DD format.'


On 10 jun, 16:18, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> > I dont want do allow empty.
>
> Then put 'allowEmpty' => false and please read the documentation.
>
> > Thevalidationdont work.
>
> > On 10 jun, 15:30, John David Anderson <[EMAIL PROTECTED]>
> > wrote:
> >> On Jun 10, 2008, at 12:01 PM, GreyWolf wrote:
>
> >> > It's 1.2
> >> > Yes, i've looked.
> >> > The documentation for datavalidationisnt good, i didnt figure it how
> >> > to validatedate.
> >> > ;~~
>
> >> Look in the "date" section:
>
> >>http://book.cakephp.org/view/140/date
>
> >> ?
>
> >> -- John
>
> >> > On 9 jun, 14:23, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> >> >> On Mon, Jun 9, 2008 at 12:56 PM, GreyWolf <[EMAIL PROTECTED]>
> >> >> wrote:
> >> >>> What's wrong? Thanks.
>
> >> >> What version of CakePHP are you using?  If you're using 1.2, have you
> >> >> looked at this:
>
> >> >>http://book.cakephp.org/view/125/data-validation
>
> >> >> --
> >> >> Chris Hartjes
> >> >> Internet Loudmouth
> >> >> Motto for 2008: "Moving from herding elephants to handling snakes..."
> >> >> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Marcin Domanski

Hey,
I don't think that a cake implementation is needed Zend_Search_Lucene
is awesome, and it doesn't have any dependencies from Zend Framework.
I'm building(finishing) a behavior wraping Zend_Search_Lucene + a
console tool for index generation  (primary for cookbook) its still
alpha but it works. it will be released soon.

As for the comparison - i planed to do some but with my basic tests -
it outperforms Mysql FULLTEXT couple times. ( LIKE %a% is way slower)
than FULLTEXT.

On Tue, Jun 10, 2008 at 8:11 PM, Jonathan Snook
<[EMAIL PROTECTED]> wrote:
>
> I think it may have been referring to the use of LIKE queries compared
> to FULLTEXT queries. And to that, I'm not sure which is faster
> although I assume the latter. It may be interesting to look at Lucene.
> (btw: a CakePHP implementation of Lucene would be awesome.)
>
> On Tue, Jun 10, 2008 at 12:33 PM, SeanW <[EMAIL PROTECTED]> wrote:
>>
>> "If users commonly search 'product names' you may want to make that
>> field a FULLTEXT index. This will make searches much faster."
>>
>> Have you verified this?  Using a fulltext index requires the "MATCHES"
>> function in the SQL, it doesn't get used if you do a "WHERE foo=" type
>> query.  I don't see any code in CakePHP that uses the MATCHES function.
>> >
>>
>
> >
>



-- 
Marcin Domanski
http://kabturek.info

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



Re: How i do date validation?

2008-06-10 Thread Dardo Sordi Bogado

> I dont want do allow empty.

Then put 'allowEmpty' => false and please read the documentation.

> The validation dont work.
>
> On 10 jun, 15:30, John David Anderson <[EMAIL PROTECTED]>
> wrote:
>> On Jun 10, 2008, at 12:01 PM, GreyWolf wrote:
>>
>>
>>
>> > It's 1.2
>> > Yes, i've looked.
>> > The documentation for datavalidationisnt good, i didnt figure it how
>> > to validatedate.
>> > ;~~
>>
>> Look in the "date" section:
>>
>> http://book.cakephp.org/view/140/date
>>
>> ?
>>
>> -- John
>>
>>
>>
>> > On 9 jun, 14:23, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>> >> On Mon, Jun 9, 2008 at 12:56 PM, GreyWolf <[EMAIL PROTECTED]>
>> >> wrote:
>> >>> What's wrong? Thanks.
>>
>> >> What version of CakePHP are you using?  If you're using 1.2, have you
>> >> looked at this:
>>
>> >>http://book.cakephp.org/view/125/data-validation
>>
>> >> --
>> >> Chris Hartjes
>> >> Internet Loudmouth
>> >> Motto for 2008: "Moving from herding elephants to handling snakes..."
>> >> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
>
> >
>

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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Pierre MARCOURT
Thank you all !
Finally, thanks to the last tip from Jonathan I added  
*ini_set('default_charset', 'utf-8');*  instead of  
ini_set('default_charset', '');  and now it is working well !!!
Thank you very much!



Jonathan Snook wrote:
> I think it'd be more appropriate to be explicit:
>
> ini_set('default_charset', 'utf-8');
>
> Alternatively, you can set the charset manually using:
> header('Content-type: text/html; charset="utf-8"');
>
> -Jonathan
>
> On Tue, Jun 10, 2008 at 1:34 PM, Pierre MARCOURT
> <[EMAIL PROTECTED]> wrote:
>   
>> Thanks Marcin,
>>
>> I am still having this problem.
>> I tried what you say but it is the same.
>> I did the comment, and I also add the line in the bootstrap.php but it does
>> not work.
>> I don't get it...
>>
>>
>> Marcin Jaworski wrote:
>>
>> The problem with UTF-8 is that you can't autodetect that the file is
>> using this charset until you use characters from outside the ascii
>> range. UTF-8 uses 1-byte encoding for this range and it isn't much
>> different from ISO then. When you use some characters from outside of
>> ASCII charset then UTF-8 encodes those characters using two bytes. If
>> you use files without BOM, then the only way to detect if file is
>> UTF-8 encoded is to check if it contains any 2-byte encoded
>> characted.
>>
>> Dreamweaver does that exactly in the same way. You probably don't have
>> any 2-byte character in your source so DW won't detect the file as
>> UTF-8. Do the test: put a comment inside some php file and place some
>> non-ascii characters in it. For example (at the end are some polish
>> characters, hope you will see them):
>> // this is a test ąśćżźó
>>
>> Save the file with this comment as UTF-8, send it to the server and
>> then try to open it with DW. You will see that it will open as UTF-8.
>>
>> About the page encoding problem: you don't need to edit any server
>> configuration file. Open app/config/bootstrap.php file and add at the
>> end:
>> ini_set('default_charset', '');
>>
>> This should do the trick.
>>
>> On 10 Cze, 17:37, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>>
>>
>> I double checked and I noticed something strange.
>> If I set the character encoding to UTF-8 without BOM via an editor and
>> then I upload it on the remote server, when I download the same file
>> from the remote server and open it with the same editor, the character
>> encoding of this file is not UTF-8 anymore but ISO.
>> I checked that because I don't have any trouble about character encoding
>> on local, and this problem happened when I uploaded all my project on a
>> remote server.
>>
>> I have to set up cakephp in a particular folder, let's say /cake/
>> So you can find my project athttp://www.my-web-site.com/cake/
>> The rest of the websitehttp://www.my-web-site.comis encoding with
>> Western (ISO).
>> Could it be the source of my trouble ? Is this a problem regarding the
>> configuration of PHP ?
>> The thing is, I don't have access to any files, I am just allow to work
>> in my /cake/ folder...
>>
>>
>>
>> Marcin Jaworski wrote:
>>
>>
>>
>> On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi,
>>
>>
>> I have just uploaded my CakePHP project on a remote server but I meet an
>> issue.
>> In all my views, I get the text "  " on the top.
>> I know this is a problem (on FF) regarding to the character encoding
>> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
>> but in local, I don't have this problem !
>> Moreover, in my default.thtml layout I set the character encoding thanks
>> to : charsetTag('UTF-8')."\n"; ?>
>> If I look at the source code, I have the meta UTF-8 defined.
>> But if I check the character encoding of my FF browser, it is : Western
>> (ISO-8859-1).
>> Plus, it is working well on IE 7 and Safari 3.1.1.
>> Finally in my editor : Dreamweaver (Sorry,
>> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
>> I have set up character encoding at UTF-8 without BOMs.
>>
>>
>> Please help me because I don't have more idea to fix this.
>>
>>
>> Regards,
>>
>>
>> The problem with page charset is because PHP sends HTTP Header
>> "Content-Type: text/html; charset=iso-8859-1". You could try and
>> override the default_charset php ini parameter by calling this as
>> early as possible:
>>
>>
>> ini_set('default_charset', '');
>>
>>
>> This will clear the default charset setting in php and allow to set
>> the charset by http equiv tag in page header.
>>
>>
>> --
>>  *Pierre MARCOURT*
>>
>> *IT Department*
>> *CableOrganizer.com*
>> 5610 NW 12th Ave, suite 214
>> Fort Lauderdale, FL 33304
>>
>> Phone: 954-861-6310
>> Fax: 954-861-2001
>>
>>
>>
>>
>> --
>>  Pierre MARCOURT
>>
>> IT Department
>> CableOrganizer.com
>> 5610 NW 12th Ave, suite 214
>> Fort Lauderdale, FL 33304
>>
>>
>> Phone: 954-861-6310
>> Fax: 954-861-2001
>> 
>
> >
>
>   


-- 
 *Pierre MARCOURT*  
 
*IT Department* 
*CableOrganizer.com*
5610 NW 12th Ave, su

Re: Why no "powered by" logo?

2008-06-10 Thread Smelly_Eddie

Just checked the link, the one I have is colored, though no different
aside.

On Jun 10, 1:36 pm, Filip Camerman <[EMAIL PROTECTED]> wrote:
> Is there a "Powered by CakePHP" logo? I'd put it on my site.
>
> All I find is thishttp://www.cakephp.org/img/cake.power.gif
>
> a bit meager :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How i do date validation?

2008-06-10 Thread GreyWolf

I've alread looked.

I dont want do allow empty.
The validation dont work.

On 10 jun, 15:30, John David Anderson <[EMAIL PROTECTED]>
wrote:
> On Jun 10, 2008, at 12:01 PM, GreyWolf wrote:
>
>
>
> > It's 1.2
> > Yes, i've looked.
> > The documentation for datavalidationisnt good, i didnt figure it how
> > to validatedate.
> > ;~~
>
> Look in the "date" section:
>
> http://book.cakephp.org/view/140/date
>
> ?
>
> -- John
>
>
>
> > On 9 jun, 14:23, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> >> On Mon, Jun 9, 2008 at 12:56 PM, GreyWolf <[EMAIL PROTECTED]>  
> >> wrote:
> >>> What's wrong? Thanks.
>
> >> What version of CakePHP are you using?  If you're using 1.2, have you
> >> looked at this:
>
> >>http://book.cakephp.org/view/125/data-validation
>
> >> --
> >> Chris Hartjes
> >> Internet Loudmouth
> >> Motto for 2008: "Moving from herding elephants to handling snakes..."
> >> @TheKeyBoard:http://www.littlehart.net/atthekeyboard

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



multi language for database tables

2008-06-10 Thread [EMAIL PROTECTED]

hi,
we're building a cakephp application where we need (beside normal l10n
functionality for static site texts) the possibility to store and
display database fields according to users language

E.g. customers should be able to store their shipping terms in several
languages. According to wich language a site user is logged in these
terms should be displayed.

Because we don't know how many languages a user needs I thought about
creating a language table to every table that holds user texts. The
normal table always only holds the base language.

So let's say theres the user table 'userdata' with fields

id
name
address
shipping_terms

and the language table 'userdata_lng' with

id (same id as in base table)
language (language code)
shipping_terms (translated text)

So how do I make my application with least programmming effort to
store and display the fields according to user language?

We thought about putting the logic into the model to be able to use
normal save/retrieve controller methods but that would mean to
overwrite every single retrieve/save method right?

Is there mayba a simpler or more elegant solution to the problem? ;)

Thanks in advance!

Cheers
Ralf

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



Re: Why no "powered by" logo?

2008-06-10 Thread Smelly_Eddie

Fillip:

I believe  the default template has the image is accompanied by the
text 'Powered by'.  That is all I was referring to. I would love to
see a more distinguished icon myself.

On Jun 10, 1:36 pm, Filip Camerman <[EMAIL PROTECTED]> wrote:
> Is there a "Powered by CakePHP" logo? I'd put it on my site.
>
> All I find is thishttp://www.cakephp.org/img/cake.power.gif
>
> a bit meager :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie

Duh.. I should have thought about that a little longer...

Thanks for the tip Andrew!



On Jun 10, 11:19 am, Andrew Assarattanakul <[EMAIL PROTECTED]> wrote:
> Try using Inflector::humanize(Inflector::underscore($this->name))
>
> On Jun 10, 10:10 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Ok I am trying thr humanize method, and have some troubles..
>
> > My new model
>
> > class CustomerProductReview extends AppModel
> > {
> > var $name = 'CustomerProductReview';
>
> > }
>
> > My new controller
>
> > class CustomerProductReviewsController extends AppController {
>
> > var $name = 'CustomerProductReviews';
> > var $uses = array('CustomerProductReview', 'Product',
> > 'Rating','User');
>
> > function beforeRender(){
> > $inf=new Inflector;
> > $this->pageTitle= $inf->humanize($this->name).' 
> > '.$this->action.'
> > - .:: The GreenLife List ::. ';
>
> > }
>
> > I also changed my table, and everthing read out ok in the views,
> > except my page title. It is show as the model name, no spaces and
> > camel cased.
>
> > But the humanize method of inflections class says it expects
> > $lowerCaseAndUnderscoredWord.
>
> > None of the options seem to take in an CamelCasedWord  the only
> > function that does is called underscore. But I want spaces, not
> > underscores,
>
> > Any ideas?
>
> > P.S. I use cake 1.1
>
> > On Jun 10, 9:37 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > It works fine; looks like your variables are mixed-up.
>
> > > You've got `var $friendlyName=...` in the model and `$model-
>
> > > >friendlyDisplay` in the controller.
>
> > > If this *still* doesn't work, try using `$this->{$this->modelClass}-
>
> > > >name` first:
>
> > > [1] $friendlyName does not work, $name does : variable name typo
> > > [2] Neither work : model name typo [make sure the primary model is
> > > first if you're using uses()]
>
> > > Must say though; if you stuck to cake conventions and called your
> > > model 'CustomerProductReview' (table: customer_product_reviews) then
> > > it would be compatible with Inflector::humanize() which is what the
> > > bake script [and scaffolding] use. Of course if your friendly name is
> > > to be more complicated than simply adding spaces, this is irrelevant.
>
> > > On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > Doesnt seem to work
>
> > > > My controller
>
> > > > class CustomerproductreviewsController extends AppController {
>
> > > > var $name = 'Customerproductreviews';
> > > > var $uses = array('Customerproductreview', 'Product',
> > > > 'Rating','User');
> > > > var $helpers = array('Html',
> > > > 'Form','Pagination','Ajax','FlashChart');
> > > > var $components = array
> > > > ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> > > > function beforeFilter(){
> > > > $this->pageTitle= 
> > > > $this->{$this->modelClass}->friendlyDisplay.'
> > > > - .:: The GreenLife List ::. ';
>
> > > > }
> > > > 
>
> > > > my model
>
> > > > class Customerproductreview extends AppModel
> > > > {
> > > > var $name = 'Customerproductreview';
> > > > var $friendlyName = 'Customer Product Reviews';
> > > > var $validate = array(
> > > > 'title' => VALID_NOT_EMPTY,
> > > > 'product' => VALID_NUMBER,
> > > > 'rating' => VALID_NUMBER,
> > > > 'reason' => VALID_NOT_EMPTY,
> > > > );
> > > > var $displayField = 'title';
> > > > var $recursive = 2;
> > > > .
>
> > > > Am I missing something?
>
> > > > On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > > class Pie extends AppModel {
> > > > >   var $friendlyName = 'A tasty treat!';
>
> > > > >   var $actsAs = array('Tasty'); // Optional
>
> > > > > }
>
> > > > > class AppController extends Controller {
> > > > >   function beforeFilter() {
> > > > > if (!empty($this->modelClass)) {
> > > > >   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > > > > - foood');
> > > > > }
> > > > >   }
>
> > > > > }
>
> > > > > Although... some might question the wisdom of setting a view-level
> > > > > parameter in the controller and the model.
>
> > > > > hth
> > > > > grigri
>
> > > > > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > > > I have always used the function below in my controllers to set the
> > > > > > page's title.
>
> > > > > > function beforeFilter(){
> > > > > > $this->pageTitle= $this->name.' - .:: The GreenLife 
> > > > > > List ::. ';
>
> > > > > > }
>
> > > > > > The problem is that some model names are concatenated due to their
> > > > > > HABTM nature, like "customerproductreviews"
>
> > > > > > I thought I could just set a variable in the Model like
> > > > > > '$displayName',  but the controllers don't see such a variable.
>
> > > > > > I know there must be a way to assign readable and formatted model

Discussion on optimizing-cakes-performance

2008-06-10 Thread Smelly_Eddie

For custom searches i tend not to use Cake's queries, but build my
own. $this->Model->query($customSQL);

For searched I use a FULLTEXT matches, as appose to LIKE.   In the
simple tests I ran this was usually faster.  Though the numbers
varied, I decided to use this method instead.

Sean is absolutely right though, using cakes query calls will not
likely show any increase in performance.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Blank Login Page

2008-06-10 Thread Arak Tai'Roth

Apparently it posted the second message I sent and not the first one,
so here is the first one over again.

@Sam
 I did what you asked, and it does indeed add the messages to the
error log in every function, including the admin_index function, but I
don't know how this helps me

@francky061
 It does redirect properly to http://mypage.com/admin/news.
However it doesn't actually display anything except the debug MySQL
data. Which amusingly enough doesn't have the query in it that I sent
it from the admin_index function

@filip
 I did try doing that, also tried echoing a string in the
admin_index function of the news controller. However nothing gets
outputted. Which, when combined with what I said to francky, leads me
to believe it isn't hitting the admin_index function, but I have no
idea why

On Jun 10, 8:51 am, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote:
> Well, I do appreciate the help, and would love it if someone was able
> to fix this problem anyways for me. I think I might just switch to
> auth, I originally didn't use auth because I thought it was going to
> be more work, clearly that is no longer the case as I could have been
> done this had I used auth a long time ago. But if you still feel like
> tackling the problem I am here.
>
> On Jun 10, 2:35 am, Filip Camerman <[EMAIL PROTECTED]> wrote:
>
> > On my current dev machine CakePHP gives me a completelyblankpage
> > without any indication of what went wrong whenever my view uses a non-
> > defined variable. So replace your view with one that just says "hello"
> > for a second and see if that gets printed; if so you know the prob.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Any Montreal cakePHP developpers?

2008-06-10 Thread Sake

Hi,

Any cakePHP developpers living in montreal? I'd like to get some
experience working with others in cakePHP and I have some ideas that
I'd like to meet with someone to develop, I'm curious if anybody on
this list is living in the city.

Let me know!

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



Re: How i do date validation?

2008-06-10 Thread John David Anderson


On Jun 10, 2008, at 12:01 PM, GreyWolf wrote:

>
> It's 1.2
> Yes, i've looked.
> The documentation for data validation isnt good, i didnt figure it how
> to validate date.
> ;~~

Look in the "date" section:

http://book.cakephp.org/view/140/date

?

-- John

>
>
> On 9 jun, 14:23, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>> On Mon, Jun 9, 2008 at 12:56 PM, GreyWolf <[EMAIL PROTECTED]>  
>> wrote:
>>> What's wrong? Thanks.
>>
>> What version of CakePHP are you using?  If you're using 1.2, have you
>> looked at this:
>>
>> http://book.cakephp.org/view/125/data-validation
>>
>> --
>> Chris Hartjes
>> Internet Loudmouth
>> Motto for 2008: "Moving from herding elephants to handling snakes..."
>> @TheKeyBoard:http://www.littlehart.net/atthekeyboard
>
> >


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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Jonathan Snook
I think it'd be more appropriate to be explicit:

ini_set('default_charset', 'utf-8');

Alternatively, you can set the charset manually using:
header('Content-type: text/html; charset="utf-8"');

-Jonathan

On Tue, Jun 10, 2008 at 1:34 PM, Pierre MARCOURT
<[EMAIL PROTECTED]> wrote:
> Thanks Marcin,
>
> I am still having this problem.
> I tried what you say but it is the same.
> I did the comment, and I also add the line in the bootstrap.php but it does
> not work.
> I don't get it...
>
>
> Marcin Jaworski wrote:
>
> The problem with UTF-8 is that you can't autodetect that the file is
> using this charset until you use characters from outside the ascii
> range. UTF-8 uses 1-byte encoding for this range and it isn't much
> different from ISO then. When you use some characters from outside of
> ASCII charset then UTF-8 encodes those characters using two bytes. If
> you use files without BOM, then the only way to detect if file is
> UTF-8 encoded is to check if it contains any 2-byte encoded
> characted.
>
> Dreamweaver does that exactly in the same way. You probably don't have
> any 2-byte character in your source so DW won't detect the file as
> UTF-8. Do the test: put a comment inside some php file and place some
> non-ascii characters in it. For example (at the end are some polish
> characters, hope you will see them):
> // this is a test ąśćżźó
>
> Save the file with this comment as UTF-8, send it to the server and
> then try to open it with DW. You will see that it will open as UTF-8.
>
> About the page encoding problem: you don't need to edit any server
> configuration file. Open app/config/bootstrap.php file and add at the
> end:
> ini_set('default_charset', '');
>
> This should do the trick.
>
> On 10 Cze, 17:37, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>
>
> I double checked and I noticed something strange.
> If I set the character encoding to UTF-8 without BOM via an editor and
> then I upload it on the remote server, when I download the same file
> from the remote server and open it with the same editor, the character
> encoding of this file is not UTF-8 anymore but ISO.
> I checked that because I don't have any trouble about character encoding
> on local, and this problem happened when I uploaded all my project on a
> remote server.
>
> I have to set up cakephp in a particular folder, let's say /cake/
> So you can find my project athttp://www.my-web-site.com/cake/
> The rest of the websitehttp://www.my-web-site.comis encoding with
> Western (ISO).
> Could it be the source of my trouble ? Is this a problem regarding the
> configuration of PHP ?
> The thing is, I don't have access to any files, I am just allow to work
> in my /cake/ folder...
>
>
>
> Marcin Jaworski wrote:
>
>
>
> On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
>
> I have just uploaded my CakePHP project on a remote server but I meet an
> issue.
> In all my views, I get the text "  " on the top.
> I know this is a problem (on FF) regarding to the character encoding
> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
> but in local, I don't have this problem !
> Moreover, in my default.thtml layout I set the character encoding thanks
> to : charsetTag('UTF-8')."\n"; ?>
> If I look at the source code, I have the meta UTF-8 defined.
> But if I check the character encoding of my FF browser, it is : Western
> (ISO-8859-1).
> Plus, it is working well on IE 7 and Safari 3.1.1.
> Finally in my editor : Dreamweaver (Sorry,
> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
> I have set up character encoding at UTF-8 without BOMs.
>
>
> Please help me because I don't have more idea to fix this.
>
>
> Regards,
>
>
> The problem with page charset is because PHP sends HTTP Header
> "Content-Type: text/html; charset=iso-8859-1". You could try and
> override the default_charset php ini parameter by calling this as
> early as possible:
>
>
> ini_set('default_charset', '');
>
>
> This will clear the default charset setting in php and allow to set
> the charset by http equiv tag in page header.
>
>
> --
>  *Pierre MARCOURT*
>
> *IT Department*
> *CableOrganizer.com*
> 5610 NW 12th Ave, suite 214
> Fort Lauderdale, FL 33304
>
> Phone: 954-861-6310
> Fax: 954-861-2001
>
>
>
>
> --
>  Pierre MARCOURT
>
> IT Department
> CableOrganizer.com
> 5610 NW 12th Ave, suite 214
> Fort Lauderdale, FL 33304
>
>
> Phone: 954-861-6310
> Fax: 954-861-2001
> >
>

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



Re: Cookies in CakePHP

2008-06-10 Thread Gonzalo Servat
On Tue, Jun 10, 2008 at 2:49 PM, Stinkbug <[EMAIL PROTECTED]> wrote:

>
> I'm still looking for an answer on this if anyone knows what the
> problem is.
>

I would personally try following the path to the __write() call in the
cookie.php component and sticking in debugging statements using print/debug
to see where it may have failed. Try printing $_COOKIE as well to see if the
cookie goes in.

Sorry, I don't have any other ideas apart from that but since nobody had
replied to you, I thought I'd suggest something that may help you in
troubleshooting.

- Gonzalo

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



Re: Discussion on optimizing-cakes-performance

2008-06-10 Thread Jonathan Snook

I think it may have been referring to the use of LIKE queries compared
to FULLTEXT queries. And to that, I'm not sure which is faster
although I assume the latter. It may be interesting to look at Lucene.
(btw: a CakePHP implementation of Lucene would be awesome.)

On Tue, Jun 10, 2008 at 12:33 PM, SeanW <[EMAIL PROTECTED]> wrote:
>
> "If users commonly search 'product names' you may want to make that
> field a FULLTEXT index. This will make searches much faster."
>
> Have you verified this?  Using a fulltext index requires the "MATCHES"
> function in the SQL, it doesn't get used if you do a "WHERE foo=" type
> query.  I don't see any code in CakePHP that uses the MATCHES function.
> >
>

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



Re: HABTM viewing all elements of an array

2008-06-10 Thread Peter54

I've tried every variation of ' ' that makes sense and the syntax is
identical to syntax that returns info from the first array (recipe) of
the multideminsional array.

The difference is that recipe is (see above) declared in the
controller but ingredient  isn't - because I don't know how.

On Jun 10, 8:55 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Constant means variables like FILE_PATH. Notice no $.
>
> I must believe that PHP is treating Ingredient as a constant that it
> cannot find.
>
> Since it cannot load that array, it also will report that the index
> 'ingredientname' cant be found. Its like finding the steering wheel
> for a car that you can see.
>
> Adding ' ' will let php engine know its a string, not a constant.
> which should then load the array, and find the index.
>
> You said the debug will print the array structure correctly, so your
> controller must be working.
>
> It will take 10 seconds to try, just do it.
>
> On Jun 10, 5:52 am, Peter54 <[EMAIL PROTECTED]> wrote:
>
> > In fact it's exactly the same syntax that works for the first array
> > (Recipe):
>
> > $todays_recipe[Recipe]['RecipeName']  - allows me to access array
> > items
> > $todays_recipe[Ingredient]['IngredientName']  give me undefined
> > constand and undefined index [IngredientName]
>
> > On Jun 10, 2:28 am, Simon COURTOIS <[EMAIL PROTECTED]> wrote:
>
> > > Peter54 wrote On 06/10/2008 02:05 AM:
>
> > > > First off I'm not just new to Cake I'm new to programing. I can get my
> > > > head around relatively simple stuff and can generalize once I have a
> > > > concept but even though I know this is either obvious, or been
> > > > answered a thousand times I can't see it anywhere or figure out how it
> > > > works.
>
> > > > I have a two tables Recipes and Ingredients and a JoinTable
> > > > Ingredients_Recipes that contains the foreign keys plus some other
> > > > data.
>
> > > > In my controller I have the following code:
> > > >$recipe = $this->Recipe->find(array('ShowDate'=>$today));
> > > >$this->set('todays_recipe', $recipe);
>
> > > > Which in debug send all the relevant elements of the all tables to the
> > > > view:
> > > > $___dataForView=   array(
> > > >"todays_recipe" => array(
> > > >"Recipe" => array(
> > > >"recipe_id" => "20",
> > > >"RecipeName" => "Banana Bread",
> > > > ),
> > > >"Ingredient" => array(
> > > >array(
> > > >"ingredient_id" => "1",
> > > >"IngredientName" => "Eggs",
> > > >"IngredientsRecipe" => array(
> > > >"id" => "1",
> > > >"recipe_id" => "20",
> > > >"ingredient_id" => "1",
> > > >"Amount" => "2",
> > > > )
>
> > > > In my view code
> > > > echo @"The dinner for $today is {$todays_recipe[Recipe]['RecipeName']}
> > > > ';
>
> > > > and I can generalize that to display anyting in the recipe array ie
> > > > serves = $todays_recipe[Recipe]['Serves']";
>
> > > > But when I try this with the Ingredients using - echo "this
> > > > {$today_recipe[Ingredient]['IngredientName']}";
>
> > > > I get undefined constants or undefined variables.
>
> > > > I assume I have to declare the ingredients array in the controller or
> > > > assign it to a variable but how? I don't know and  at the risk of
> > > > appearing stupid or irritating I thought I'd ask.
>
> > > Hi,
>
> > > Isn't it a quote problem ? U do $today_recipe[Ingredient] instead of
> > > $today_recipe['Ingredient'].
> > > I hope it's because of it ;)
>
> > > --
> > > Simon COURTOIS
> > > {EPITECH.} tek4 | (LINAGORA) Developer | [ADITAM] Project Manager
> > > 10, rue Brillat-Savarin 75013 Paris | 01 45 42 72 30 - 06 72 44 67 
> > > 81http://www.happynoff.fr

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



Re: Cookies in CakePHP

2008-06-10 Thread Stinkbug

I'm still looking for an answer on this if anyone knows what the
problem is.

On Jun 8, 4:59 pm, Stinkbug <[EMAIL PROTECTED]> wrote:
> Here is some test code that I used to test cookies with.
>
>  class StudiesController extends AppController {
> var $name = 'Studies';
>
> function index() {
> if ($this->Session->check('user_id')) {
> echo $this->Cookie->read('password');
> $this->Session->setFlash('You are logged in!');
> }
> }
>
> function getstarted() {
> $password = Security::generateAuthKey();
> $this->Cookie->write('password', $password);
> if ($this->Study->User->save(array('password' => $password))) 
> {
> $this->Session->write('user_id', 
> $this->Study->User->id);
> }
> //echo $this->Cookie->read('password');
> $this->redirect('/studies');
> }}
>
> ?>
>
> If I call the getstarted method first, after the redirect to the index
> method I'm trying to read the cookie that I previously wrote and it's
> not showing up.  Any ideas why?  I'm assuming I'm doing something
> wrong.

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



Apache crashes when using mysql_connect

2008-06-10 Thread Roman Onufryk
Hi all.

I use Apache 1.3.33 / php-5.2.4 / mysql 5.1.24 / cake_1.1.19.6305

If I define 'connect' => 'mysql_connect' in the database.php and trying to
open application in a browser, Windows Shows application crash window:

szAppName : Apache.exe szAppVer : 0.0.0.0 szModName : php5ts.dll

szModVer : 5.2.4.4 offset : a96a

If I define 'connect' => 'mysql_pconnect' - everything works OK.

Today I spent a whole day searching for an origin of the bug and tried
Apache 1.33, Apache 2, PHP 4.4.8, PHP 5.2.0-5.2.6.
It crashes on all PHP version since 5.2.0 (it works with 4.4.8 - but it
doesn't connect with mysql 5)

Has anyone encountered such bug? Any solutions?



-- 
Best,
Roman Onufryk

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



Re: How i do date validation?

2008-06-10 Thread GreyWolf

It's 1.2
Yes, i've looked.
The documentation for data validation isnt good, i didnt figure it how
to validate date.
;~~

On 9 jun, 14:23, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Mon, Jun 9, 2008 at 12:56 PM, GreyWolf <[EMAIL PROTECTED]> wrote:
> > What's wrong? Thanks.
>
> What version of CakePHP are you using?  If you're using 1.2, have you
> looked at this:
>
> http://book.cakephp.org/view/125/data-validation
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @TheKeyBoard:http://www.littlehart.net/atthekeyboard

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



Re: Why no "powered by" logo?

2008-06-10 Thread Filip Camerman

Is there a "Powered by CakePHP" logo? I'd put it on my site.

All I find is this
http://www.cakephp.org/img/cake.power.gif

a bit meager :)

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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Pierre MARCOURT
Thanks Marcin,

I am still having this problem.
I tried what you say but it is the same.
I did the comment, and I also add the line in the bootstrap.php but it 
does not work.
I don't get it...


Marcin Jaworski wrote:
> The problem with UTF-8 is that you can't autodetect that the file is
> using this charset until you use characters from outside the ascii
> range. UTF-8 uses 1-byte encoding for this range and it isn't much
> different from ISO then. When you use some characters from outside of
> ASCII charset then UTF-8 encodes those characters using two bytes. If
> you use files without BOM, then the only way to detect if file is
> UTF-8 encoded is to check if it contains any 2-byte encoded
> characted.
>
> Dreamweaver does that exactly in the same way. You probably don't have
> any 2-byte character in your source so DW won't detect the file as
> UTF-8. Do the test: put a comment inside some php file and place some
> non-ascii characters in it. For example (at the end are some polish
> characters, hope you will see them):
> // this is a test ąśćżźó
>
> Save the file with this comment as UTF-8, send it to the server and
> then try to open it with DW. You will see that it will open as UTF-8.
>
> About the page encoding problem: you don't need to edit any server
> configuration file. Open app/config/bootstrap.php file and add at the
> end:
> ini_set('default_charset', '');
>
> This should do the trick.
>
> On 10 Cze, 17:37, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>   
>> I double checked and I noticed something strange.
>> If I set the character encoding to UTF-8 without BOM via an editor and
>> then I upload it on the remote server, when I download the same file
>> from the remote server and open it with the same editor, the character
>> encoding of this file is not UTF-8 anymore but ISO.
>> I checked that because I don't have any trouble about character encoding
>> on local, and this problem happened when I uploaded all my project on a
>> remote server.
>>
>> I have to set up cakephp in a particular folder, let's say /cake/
>> So you can find my project athttp://www.my-web-site.com/cake/
>> The rest of the websitehttp://www.my-web-site.comis encoding with
>> Western (ISO).
>> Could it be the source of my trouble ? Is this a problem regarding the
>> configuration of PHP ?
>> The thing is, I don't have access to any files, I am just allow to work
>> in my /cake/ folder...
>>
>>
>>
>> Marcin Jaworski wrote:
>>
>> 
>>> On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>>>   
 Hi,
 
 I have just uploaded my CakePHP project on a remote server but I meet an
 issue.
 In all my views, I get the text "  " on the top.
 I know this is a problem (on FF) regarding to the character encoding
 (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
 but in local, I don't have this problem !
 Moreover, in my default.thtml layout I set the character encoding thanks
 to : charsetTag('UTF-8')."\n"; ?>
 If I look at the source code, I have the meta UTF-8 defined.
 But if I check the character encoding of my FF browser, it is : Western
 (ISO-8859-1).
 Plus, it is working well on IE 7 and Safari 3.1.1.
 Finally in my editor : Dreamweaver (Sorry, 
 cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
 I have set up character encoding at UTF-8 without BOMs.
 
 Please help me because I don't have more idea to fix this.
 
 Regards,
 
>>> The problem with page charset is because PHP sends HTTP Header
>>> "Content-Type: text/html; charset=iso-8859-1". You could try and
>>> override the default_charset php ini parameter by calling this as
>>> early as possible:
>>>   
>>> ini_set('default_charset', '');
>>>   
>>> This will clear the default charset setting in php and allow to set
>>> the charset by http equiv tag in page header.
>>>   
>> --
>>  *Pierre MARCOURT*  
>>
>> *IT Department*
>> *CableOrganizer.com*
>> 5610 NW 12th Ave, suite 214
>> Fort Lauderdale, FL 33304
>>
>> Phone: 954-861-6310
>> Fax: 954-861-2001
>> 
> >
>
>   


-- 
 *Pierre MARCOURT*  
 
*IT Department* 
*CableOrganizer.com*
5610 NW 12th Ave, suite 214
Fort Lauderdale, FL 33304
 


Phone: 954-861-6310
Fax: 954-861-2001


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



blank page when view has an error

2008-06-10 Thread Filip Camerman

Whenever there's a php error in a view, I get a completely blank page
in my browser. I can live with it but it's annoying and I wonder if
anyone knows a solution.

Some info
- I use Cake 1.2 on Apache
- php.ini has "display_errors = On" and "error_reporting  =  E_ALL",
and I get to see php errors in normal php scripts that I run on this
server (my PC), so I assume the server config is not the problem
- My Cake debug level = 3 and errors in controllers are reported by
Cake just fine, only errors in views cause the problem
- when I get the blank page, it seems it actually crashes the Apache
server as Apache's error.log says:

[Tue Jun 10 19:02:49 2008] [notice] Parent: child process exited with
status 3221225477 -- Restarting.
[Tue Jun 10 19:02:49 2008] [notice] Apache/2.2.8 (Win32) PHP/5.2.6
configured -- resuming normal operations


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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Marcin Jaworski

The problem with UTF-8 is that you can't autodetect that the file is
using this charset until you use characters from outside the ascii
range. UTF-8 uses 1-byte encoding for this range and it isn't much
different from ISO then. When you use some characters from outside of
ASCII charset then UTF-8 encodes those characters using two bytes. If
you use files without BOM, then the only way to detect if file is
UTF-8 encoded is to check if it contains any 2-byte encoded
characted.

Dreamweaver does that exactly in the same way. You probably don't have
any 2-byte character in your source so DW won't detect the file as
UTF-8. Do the test: put a comment inside some php file and place some
non-ascii characters in it. For example (at the end are some polish
characters, hope you will see them):
// this is a test ąśćżźó

Save the file with this comment as UTF-8, send it to the server and
then try to open it with DW. You will see that it will open as UTF-8.

About the page encoding problem: you don't need to edit any server
configuration file. Open app/config/bootstrap.php file and add at the
end:
ini_set('default_charset', '');

This should do the trick.

On 10 Cze, 17:37, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
> I double checked and I noticed something strange.
> If I set the character encoding to UTF-8 without BOM via an editor and
> then I upload it on the remote server, when I download the same file
> from the remote server and open it with the same editor, the character
> encoding of this file is not UTF-8 anymore but ISO.
> I checked that because I don't have any trouble about character encoding
> on local, and this problem happened when I uploaded all my project on a
> remote server.
>
> I have to set up cakephp in a particular folder, let's say /cake/
> So you can find my project athttp://www.my-web-site.com/cake/
> The rest of the websitehttp://www.my-web-site.comis encoding with
> Western (ISO).
> Could it be the source of my trouble ? Is this a problem regarding the
> configuration of PHP ?
> The thing is, I don't have access to any files, I am just allow to work
> in my /cake/ folder...
>
>
>
> Marcin Jaworski wrote:
>
> > On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>
> >> Hi,
>
> >> I have just uploaded my CakePHP project on a remote server but I meet an
> >> issue.
> >> In all my views, I get the text "  " on the top.
> >> I know this is a problem (on FF) regarding to the character encoding
> >> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
> >> but in local, I don't have this problem !
> >> Moreover, in my default.thtml layout I set the character encoding thanks
> >> to : charsetTag('UTF-8')."\n"; ?>
> >> If I look at the source code, I have the meta UTF-8 defined.
> >> But if I check the character encoding of my FF browser, it is : Western
> >> (ISO-8859-1).
> >> Plus, it is working well on IE 7 and Safari 3.1.1.
> >> Finally in my editor : Dreamweaver (Sorry, 
> >> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
> >> I have set up character encoding at UTF-8 without BOMs.
>
> >> Please help me because I don't have more idea to fix this.
>
> >> Regards,
>
> > The problem with page charset is because PHP sends HTTP Header
> > "Content-Type: text/html; charset=iso-8859-1". You could try and
> > override the default_charset php ini parameter by calling this as
> > early as possible:
>
> > ini_set('default_charset', '');
>
> > This will clear the default charset setting in php and allow to set
> > the charset by http equiv tag in page header.
>
> --
>  *Pierre MARCOURT*      
>
> *IT Department*        
>         *CableOrganizer.com*
> 5610 NW 12th Ave, suite 214
> Fort Lauderdale, FL 33304
>
>         Phone: 954-861-6310
> Fax: 954-861-2001
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Discussion on optimizing-cakes-performance

2008-06-10 Thread SeanW

"If users commonly search 'product names' you may want to make that
field a FULLTEXT index. This will make searches much faster."

Have you verified this?  Using a fulltext index requires the "MATCHES"
function in the SQL, it doesn't get used if you do a "WHERE foo=" type
query.  I don't see any code in CakePHP that uses the MATCHES function.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Ajax Autocomplete is not working !

2008-06-10 Thread MMatchan

Hi all,

Im brand new to Cake and to PHP in general. Im trying to setup a
simple Ajax Autocomplete script going.. I have a DB table called Posts
with a bunch of names called Title.
I just want to have a simple textbox that autocompletes and fills in
the selected title...

Im using CAKE PHP v 1.2 . My probem is that the textbox renders
correctly but the AJAX part is not working What am I missing ? Pls
help

Here is a snippet from my controller (posts_controller.php)

 function autoComplete()
{
echo 'in the loop';
  //$this->set('posts',$this->Post->findAll("title LIKE '{$this-
>data['Post']['title']}'"));
$this->set('posts', $this->Post->findAll());
$this->layout = 'ajax';
 }


Here is a snippet from my view (view.thtml)


  autoComplete('Post/title' ,'/myapps/blog/posts/
autoComplete');?>



Here is a snippet from my view (auto_complete.thml)

 
 
 
 
 
   



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



When the bake script complains about enum after you've removed them...

2008-06-10 Thread clarkphp

If you've removed all enum data types from your tables, but getting
complaints about them from the schema generator when baking models or
controllers, or if the bake script is not seeing database tables you
*know* are there, clearing out the files in app/tmp/models should
solve your problem.

Back to baking...

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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Pierre MARCOURT
I double checked and I noticed something strange.
If I set the character encoding to UTF-8 without BOM via an editor and 
then I upload it on the remote server, when I download the same file 
from the remote server and open it with the same editor, the character 
encoding of this file is not UTF-8 anymore but ISO.
I checked that because I don't have any trouble about character encoding 
on local, and this problem happened when I uploaded all my project on a 
remote server.

I have to set up cakephp in a particular folder, let's say /cake/
So you can find my project at http://www.my-web-site.com/cake/
The rest of the website http://www.my-web-site.com is encoding with 
Western (ISO).
Could it be the source of my trouble ? Is this a problem regarding the 
configuration of PHP ?
The thing is, I don't have access to any files, I am just allow to work 
in my /cake/ folder...


Marcin Jaworski wrote:
>
> On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
>   
>> Hi,
>>
>> I have just uploaded my CakePHP project on a remote server but I meet an
>> issue.
>> In all my views, I get the text "  " on the top.
>> I know this is a problem (on FF) regarding to the character encoding
>> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
>> but in local, I don't have this problem !
>> Moreover, in my default.thtml layout I set the character encoding thanks
>> to : charsetTag('UTF-8')."\n"; ?>
>> If I look at the source code, I have the meta UTF-8 defined.
>> But if I check the character encoding of my FF browser, it is : Western
>> (ISO-8859-1).
>> Plus, it is working well on IE 7 and Safari 3.1.1.
>> Finally in my editor : Dreamweaver (Sorry, 
>> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
>> I have set up character encoding at UTF-8 without BOMs.
>>
>> Please help me because I don't have more idea to fix this.
>>
>> Regards,
>>
>> 
>
> The problem with page charset is because PHP sends HTTP Header
> "Content-Type: text/html; charset=iso-8859-1". You could try and
> override the default_charset php ini parameter by calling this as
> early as possible:
>
> ini_set('default_charset', '');
>
> This will clear the default charset setting in php and allow to set
> the charset by http equiv tag in page header.
> >
>
>   


-- 
 *Pierre MARCOURT*  
 
*IT Department* 
*CableOrganizer.com*
5610 NW 12th Ave, suite 214
Fort Lauderdale, FL 33304
 


Phone: 954-861-6310
Fax: 954-861-2001


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



Re: simple ajax based form

2008-06-10 Thread clemos

Hi teum

I think your problem is here :

> submit("Go! Go! Go!", array("with" => "testform")); ?
>>

the "with" option should be "A Javascript expression specifying the
parameters for the XMLHttpRequest. This defaults to
Form.Element.serialize('$field'), which can be accessed from
params['form']['field_id']"

Though not mentionned in AjaxHelper::submit, it is mentionned here:
http://api.cakephp.org/class_ajax_helper.html#7910bf5f8ff355ecbbac3706ab97d283

+++
Clément

On Tue, Jun 10, 2008 at 5:08 PM, teum <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've been using google for too long now and I still haven't found what
> I am looking for. I'm just trying to submit a form using ajax (Cake
> 1.2) and I'm going through hell. It is supposed to be simple with
> cakephp so I must be really bad... Without ajax it works.
>
> Here's my form :
>
> form('index', 'post', array('update' => 'content',
> 'id' => 'testform')); ?>
> input('critere_tri', array('options' =>
> array("Participant.magasin_id" => "Magasin"))); ?>
> submit("Go! Go! Go!", array("with" => "testform")); ?
>>
> 
>
> The controller :
>
> class CreationsController extends AppController
> {
>var $name = "Creations";
>var $components = array("Auth");
>var $uses = array("Participant", "Creation");
>var $helpers = array('Form', 'Ajax');
>
>function index()
>{
>if(!empty($this->data)
>$this->set($this->data); // To verify if the request 
> is successful
>$this->set("participantsMagasinCreations", $this->Participant-
>>findAll());
>}
> }
>
> I want to get the value from the list and use it in the findAll()
> order condition. For the moment I just display it. But it doesn't
> work.
>
> There's the following javascript error : "testform is not defined".
> And I checked in the source of the document, the form has
> "id='testform' ...
>
>
> Thanks in advance for helping me.
>
>
> >
>

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



Re: Page titles that read well

2008-06-10 Thread Andrew Assarattanakul

Try using Inflector::humanize(Inflector::underscore($this->name))

On Jun 10, 10:10 am, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Ok I am trying thr humanize method, and have some troubles..
>
> My new model
>
> class CustomerProductReview extends AppModel
> {
>     var $name = 'CustomerProductReview';
>
> }
>
> My new controller
>
> class CustomerProductReviewsController extends AppController {
>
>         var $name = 'CustomerProductReviews';
>         var $uses = array('CustomerProductReview', 'Product',
> 'Rating','User');
>
>         function beforeRender(){
>                 $inf=new Inflector;
>                 $this->pageTitle= $inf->humanize($this->name).' 
> '.$this->action.'
> - .:: The GreenLife List ::. ';
>
>         }
>
> I also changed my table, and everthing read out ok in the views,
> except my page title. It is show as the model name, no spaces and
> camel cased.
>
> But the humanize method of inflections class says it expects
> $lowerCaseAndUnderscoredWord.
>
> None of the options seem to take in an CamelCasedWord  the only
> function that does is called underscore. But I want spaces, not
> underscores,
>
> Any ideas?
>
> P.S. I use cake 1.1
>
> On Jun 10, 9:37 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > It works fine; looks like your variables are mixed-up.
>
> > You've got `var $friendlyName=...` in the model and `$model-
>
> > >friendlyDisplay` in the controller.
>
> > If this *still* doesn't work, try using `$this->{$this->modelClass}-
>
> > >name` first:
>
> > [1] $friendlyName does not work, $name does : variable name typo
> > [2] Neither work : model name typo [make sure the primary model is
> > first if you're using uses()]
>
> > Must say though; if you stuck to cake conventions and called your
> > model 'CustomerProductReview' (table: customer_product_reviews) then
> > it would be compatible with Inflector::humanize() which is what the
> > bake script [and scaffolding] use. Of course if your friendly name is
> > to be more complicated than simply adding spaces, this is irrelevant.
>
> > On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > Doesnt seem to work
>
> > > My controller
>
> > > class CustomerproductreviewsController extends AppController {
>
> > >         var $name = 'Customerproductreviews';
> > >         var $uses = array('Customerproductreview', 'Product',
> > > 'Rating','User');
> > >         var $helpers = array('Html',
> > > 'Form','Pagination','Ajax','FlashChart');
> > >         var $components = array
> > > ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> > >         function beforeFilter(){
> > >                 $this->pageTitle= 
> > > $this->{$this->modelClass}->friendlyDisplay.'
> > > - .:: The GreenLife List ::. ';
>
> > >         }
> > > 
>
> > > my model
>
> > > class Customerproductreview extends AppModel
> > > {
> > >     var $name = 'Customerproductreview';
> > >     var $friendlyName = 'Customer Product Reviews';
> > >         var $validate = array(
> > >         'title' => VALID_NOT_EMPTY,
> > >         'product' => VALID_NUMBER,
> > >         'rating' => VALID_NUMBER,
> > >         'reason' => VALID_NOT_EMPTY,
> > >     );
> > >         var $displayField = 'title';
> > >         var $recursive = 2;
> > > .
>
> > > Am I missing something?
>
> > > On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > class Pie extends AppModel {
> > > >   var $friendlyName = 'A tasty treat!';
>
> > > >   var $actsAs = array('Tasty'); // Optional
>
> > > > }
>
> > > > class AppController extends Controller {
> > > >   function beforeFilter() {
> > > >     if (!empty($this->modelClass)) {
> > > >       $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > > > - foood');
> > > >     }
> > > >   }
>
> > > > }
>
> > > > Although... some might question the wisdom of setting a view-level
> > > > parameter in the controller and the model.
>
> > > > hth
> > > > grigri
>
> > > > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > > I have always used the function below in my controllers to set the
> > > > > page's title.
>
> > > > > function beforeFilter(){
> > > > >                 $this->pageTitle= $this->name.' - .:: The GreenLife 
> > > > > List ::. ';
>
> > > > > }
>
> > > > > The problem is that some model names are concatenated due to their
> > > > > HABTM nature, like "customerproductreviews"
>
> > > > > I thought I could just set a variable in the Model like
> > > > > '$displayName',  but the controllers don't see such a variable.
>
> > > > > I know there must be a way to assign readable and formatted model
> > > > > names to use in the page title.
>
> > > > > It wold also be useful when other models read related data, the bake
> > > > > script could show "related customer reviews" in my other models,
> > > > > rather than the ugly one word name.
>
> > > > > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You

Re: blog list

2008-06-10 Thread Sliv

The links in the unofficial resources page will take you to pre-
defined searches in the blogosphere for cakephp which will give you a
lot of relevant results from many indexed blogs.

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



Re: UTF-8 : I don't get it !

2008-06-10 Thread Marcin Jaworski



On 10 Cze, 16:23, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have just uploaded my CakePHP project on a remote server but I meet an
> issue.
> In all my views, I get the text "  " on the top.
> I know this is a problem (on FF) regarding to the character encoding
> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
> but in local, I don't have this problem !
> Moreover, in my default.thtml layout I set the character encoding thanks
> to : charsetTag('UTF-8')."\n"; ?>
> If I look at the source code, I have the meta UTF-8 defined.
> But if I check the character encoding of my FF browser, it is : Western
> (ISO-8859-1).
> Plus, it is working well on IE 7 and Safari 3.1.1.
> Finally in my editor : Dreamweaver (Sorry, 
> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
> I have set up character encoding at UTF-8 without BOMs.
>
> Please help me because I don't have more idea to fix this.
>
> Regards,
>

The problem with page charset is because PHP sends HTTP Header
"Content-Type: text/html; charset=iso-8859-1". You could try and
override the default_charset php ini parameter by calling this as
early as possible:

ini_set('default_charset', '');

This will clear the default charset setting in php and allow to set
the charset by http equiv tag in page header.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: simple ajax based form

2008-06-10 Thread teum

Just a correction :

if(!empty($this->data))
$this->set("data", $this->data);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie

Ok I am trying thr humanize method, and have some troubles..

My new model

class CustomerProductReview extends AppModel
{
var $name = 'CustomerProductReview';
}


My new controller


class CustomerProductReviewsController extends AppController {

var $name = 'CustomerProductReviews';
var $uses = array('CustomerProductReview', 'Product',
'Rating','User');



function beforeRender(){
$inf=new Inflector;
$this->pageTitle= $inf->humanize($this->name).' 
'.$this->action.'
- .:: The GreenLife List ::. ';

}


I also changed my table, and everthing read out ok in the views,
except my page title. It is show as the model name, no spaces and
camel cased.

But the humanize method of inflections class says it expects
$lowerCaseAndUnderscoredWord.

None of the options seem to take in an CamelCasedWord  the only
function that does is called underscore. But I want spaces, not
underscores,

Any ideas?

P.S. I use cake 1.1

On Jun 10, 9:37 am, grigri <[EMAIL PROTECTED]> wrote:
> It works fine; looks like your variables are mixed-up.
>
> You've got `var $friendlyName=...` in the model and `$model-
>
> >friendlyDisplay` in the controller.
>
> If this *still* doesn't work, try using `$this->{$this->modelClass}-
>
> >name` first:
>
> [1] $friendlyName does not work, $name does : variable name typo
> [2] Neither work : model name typo [make sure the primary model is
> first if you're using uses()]
>
> Must say though; if you stuck to cake conventions and called your
> model 'CustomerProductReview' (table: customer_product_reviews) then
> it would be compatible with Inflector::humanize() which is what the
> bake script [and scaffolding] use. Of course if your friendly name is
> to be more complicated than simply adding spaces, this is irrelevant.
>
> On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Doesnt seem to work
>
> > My controller
>
> > class CustomerproductreviewsController extends AppController {
>
> > var $name = 'Customerproductreviews';
> > var $uses = array('Customerproductreview', 'Product',
> > 'Rating','User');
> > var $helpers = array('Html',
> > 'Form','Pagination','Ajax','FlashChart');
> > var $components = array
> > ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> > function beforeFilter(){
> > $this->pageTitle= 
> > $this->{$this->modelClass}->friendlyDisplay.'
> > - .:: The GreenLife List ::. ';
>
> > }
> > 
>
> > my model
>
> > class Customerproductreview extends AppModel
> > {
> > var $name = 'Customerproductreview';
> > var $friendlyName = 'Customer Product Reviews';
> > var $validate = array(
> > 'title' => VALID_NOT_EMPTY,
> > 'product' => VALID_NUMBER,
> > 'rating' => VALID_NUMBER,
> > 'reason' => VALID_NOT_EMPTY,
> > );
> > var $displayField = 'title';
> > var $recursive = 2;
> > .
>
> > Am I missing something?
>
> > On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > class Pie extends AppModel {
> > >   var $friendlyName = 'A tasty treat!';
>
> > >   var $actsAs = array('Tasty'); // Optional
>
> > > }
>
> > > class AppController extends Controller {
> > >   function beforeFilter() {
> > > if (!empty($this->modelClass)) {
> > >   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > > - foood');
> > > }
> > >   }
>
> > > }
>
> > > Although... some might question the wisdom of setting a view-level
> > > parameter in the controller and the model.
>
> > > hth
> > > grigri
>
> > > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > I have always used the function below in my controllers to set the
> > > > page's title.
>
> > > > function beforeFilter(){
> > > > $this->pageTitle= $this->name.' - .:: The GreenLife 
> > > > List ::. ';
>
> > > > }
>
> > > > The problem is that some model names are concatenated due to their
> > > > HABTM nature, like "customerproductreviews"
>
> > > > I thought I could just set a variable in the Model like
> > > > '$displayName',  but the controllers don't see such a variable.
>
> > > > I know there must be a way to assign readable and formatted model
> > > > names to use in the page title.
>
> > > > It wold also be useful when other models read related data, the bake
> > > > script could show "related customer reviews" in my other models,
> > > > rather than the ugly one word name.
>
> > > > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---

simple ajax based form

2008-06-10 Thread teum

Hi,

I've been using google for too long now and I still haven't found what
I am looking for. I'm just trying to submit a form using ajax (Cake
1.2) and I'm going through hell. It is supposed to be simple with
cakephp so I must be really bad... Without ajax it works.

Here's my form :

form('index', 'post', array('update' => 'content',
'id' => 'testform')); ?>
input('critere_tri', array('options' =>
array("Participant.magasin_id" => "Magasin"))); ?>
submit("Go! Go! Go!", array("with" => "testform")); ?
>


The controller :

class CreationsController extends AppController
{
var $name = "Creations";
var $components = array("Auth");
var $uses = array("Participant", "Creation");
var $helpers = array('Form', 'Ajax');

function index()
{
if(!empty($this->data)
$this->set($this->data); // To verify if the request is 
successful
$this->set("participantsMagasinCreations", $this->Participant-
>findAll());
}
}

I want to get the value from the list and use it in the findAll()
order condition. For the moment I just display it. But it doesn't
work.

There's the following javascript error : "testform is not defined".
And I checked in the source of the document, the form has
"id='testform' ...


Thanks in advance for helping me.


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



Re: blog list

2008-06-10 Thread scs

Oh I saw this before. I thought it was a bigger list than just these.
thanks though.

On Jun 9, 7:06 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> http://www.cakephp.org/<--- click on the "read" link
>
> http://groups.google.com/group/cake-php/web/cakephp-official-resourceshttp://groups.google.com/group/cake-php/web/cakephp-unofficial-resourceshttp://groups.google.com/group/cake-php/web/cakephp-in-the-wild#blogs
>
> Regards,
> - Dardo Sordi.
>
> On Mon, Jun 9, 2008 at 4:59 PM, scs <[EMAIL PROTECTED]> wrote:
>
> > I been looking all over the cakephp site since it first came up and
> > searched Google for it but I have never found the "office blog list".
> > I'm interested in seeing if there are other blogs (besides the few I
> > found in my daily search for cake information) that I can use to look
> > for the answers to my problems. Can someone point out to me where in
> > cakephp this list is located since I must be as blind as a bat and
> > never run across this list???
>
> > Thanks for the help and happy Baking to you all!!!

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



Re: Select or text field depending on another select

2008-06-10 Thread DaveMahon

Changing the contents of controls and activating/deactivating is
appropriate, but alternating between select and text input depending
on the value of another select? That's a very good way of confusing
and frustrating users. My gut instinct is that a wizard style
interface, where you get routed to different screens depending on the
value provided on the first screen would be far less confusing and
frustrating for users.

On Jun 10, 4:27 am, Filip Camerman <[EMAIL PROTECTED]> wrote:
> Really? Seems pretty standard to me to have a self-changing form. E.g.
> you select a country in one select box and then the next box changes
> to hold that country's regions or cities.

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



Re: Blank Login Page

2008-06-10 Thread Arak Tai'Roth

Well, I do appreciate the help, and would love it if someone was able
to fix this problem anyways for me. I think I might just switch to
auth, I originally didn't use auth because I thought it was going to
be more work, clearly that is no longer the case as I could have been
done this had I used auth a long time ago. But if you still feel like
tackling the problem I am here.

On Jun 10, 2:35 am, Filip Camerman <[EMAIL PROTECTED]> wrote:
> On my current dev machine CakePHP gives me a completelyblankpage
> without any indication of what went wrong whenever my view uses a non-
> defined variable. So replace your view with one that just says "hello"
> for a second and see if that gets printed; if so you know the prob.

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



Re: UTF-8 : I don't get it !

2008-06-10 Thread grigri

The "" is a UTF-8 BOM (hex EF BB BF).

Double-check your config, then make sure ALL of the files have no BOM.

hth
grigri

On Jun 10, 3:23 pm, Pierre MARCOURT <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have just uploaded my CakePHP project on a remote server but I meet an
> issue.
> In all my views, I get the text "  " on the top.
> I know this is a problem (on FF) regarding to the character encoding
> (cf.http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2...)
> but in local, I don't have this problem !
> Moreover, in my default.thtml layout I set the character encoding thanks
> to : charsetTag('UTF-8')."\n"; ?>
> If I look at the source code, I have the meta UTF-8 defined.
> But if I check the character encoding of my FF browser, it is : Western
> (ISO-8859-1).
> Plus, it is working well on IE 7 and Safari 3.1.1.
> Finally in my editor : Dreamweaver (Sorry, 
> cfhttp://groups.google.ch/group/cake-php/browse_thread/thread/392484f52...)
> I have set up character encoding at UTF-8 without BOMs.
>
> Please help me because I don't have more idea to fix this.
>
> Regards,
>
> --
>  *Pierre MARCOURT*
>
> *IT Department*
> *CableOrganizer.com*
> 5610 NW 12th Ave, suite 214
> Fort Lauderdale, FL 33304
>
> Phone: 954-861-6310
> Fax: 954-861-2001
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie

Thank you!

Silly typos always get me down.

Adding the actions is a great idea.

I think I may update my models to fix the inflections issue.

Thanks again!

On Jun 10, 9:37 am, grigri <[EMAIL PROTECTED]> wrote:
> It works fine; looks like your variables are mixed-up.
>
> You've got `var $friendlyName=...` in the model and `$model-
>
> >friendlyDisplay` in the controller.
>
> If this *still* doesn't work, try using `$this->{$this->modelClass}-
>
> >name` first:
>
> [1] $friendlyName does not work, $name does : variable name typo
> [2] Neither work : model name typo [make sure the primary model is
> first if you're using uses()]
>
> Must say though; if you stuck to cake conventions and called your
> model 'CustomerProductReview' (table: customer_product_reviews) then
> it would be compatible with Inflector::humanize() which is what the
> bake script [and scaffolding] use. Of course if your friendly name is
> to be more complicated than simply adding spaces, this is irrelevant.
>
> On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > Doesnt seem to work
>
> > My controller
>
> > class CustomerproductreviewsController extends AppController {
>
> > var $name = 'Customerproductreviews';
> > var $uses = array('Customerproductreview', 'Product',
> > 'Rating','User');
> > var $helpers = array('Html',
> > 'Form','Pagination','Ajax','FlashChart');
> > var $components = array
> > ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> > function beforeFilter(){
> > $this->pageTitle= 
> > $this->{$this->modelClass}->friendlyDisplay.'
> > - .:: The GreenLife List ::. ';
>
> > }
> > 
>
> > my model
>
> > class Customerproductreview extends AppModel
> > {
> > var $name = 'Customerproductreview';
> > var $friendlyName = 'Customer Product Reviews';
> > var $validate = array(
> > 'title' => VALID_NOT_EMPTY,
> > 'product' => VALID_NUMBER,
> > 'rating' => VALID_NUMBER,
> > 'reason' => VALID_NOT_EMPTY,
> > );
> > var $displayField = 'title';
> > var $recursive = 2;
> > .
>
> > Am I missing something?
>
> > On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > > class Pie extends AppModel {
> > >   var $friendlyName = 'A tasty treat!';
>
> > >   var $actsAs = array('Tasty'); // Optional
>
> > > }
>
> > > class AppController extends Controller {
> > >   function beforeFilter() {
> > > if (!empty($this->modelClass)) {
> > >   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > > - foood');
> > > }
> > >   }
>
> > > }
>
> > > Although... some might question the wisdom of setting a view-level
> > > parameter in the controller and the model.
>
> > > hth
> > > grigri
>
> > > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > > I have always used the function below in my controllers to set the
> > > > page's title.
>
> > > > function beforeFilter(){
> > > > $this->pageTitle= $this->name.' - .:: The GreenLife 
> > > > List ::. ';
>
> > > > }
>
> > > > The problem is that some model names are concatenated due to their
> > > > HABTM nature, like "customerproductreviews"
>
> > > > I thought I could just set a variable in the Model like
> > > > '$displayName',  but the controllers don't see such a variable.
>
> > > > I know there must be a way to assign readable and formatted model
> > > > names to use in the page title.
>
> > > > It wold also be useful when other models read related data, the bake
> > > > script could show "related customer reviews" in my other models,
> > > > rather than the ugly one word name.
>
> > > > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Infinite redirect when logout with AuthComponent

2008-06-10 Thread Marcelius

Hi

Just upgraded to CakePHP RC1 and after some minor fixes I found that I
couldn't properly logout anymore. It caused the browser to continously
redirect to the originating url. I found that the problem lies in the
components used by my users controller:

In UsersController:
public function logout() {
  $this->Auth->logout();
  $this->redirect(array("controller"=>"users", "action"=>"login",
"plugin"=>"nedcore"));
}

But instead of redirecting to "/users/login" the browser is redirected
to "" which is the same as the original url, in my case "/users/
logout".

I have fixed this by adding the following method in all components
used by the users controller:

public function beforeRedirect(){
  return null;
}

I don't know what the bug is exactly but I figured maybe someone else
has the same problem...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session problem

2008-06-10 Thread Andrew Assarattanakul

Check a few of these discussions as a few other people have had this
issue and resolved it.

http://groups.google.com/group/cake-php/browse_thread/thread/c4b30b02adaf4a9f/f71248fa3cb18220
http://groups.google.com/group/cake-php/browse_thread/thread/b173577dbca8b3f9#


On Jun 10, 5:20 am, koko <[EMAIL PROTECTED]> wrote:
> Anybody found a solution to this  ?? I am having the exact same
> problem here !!
>
> On May 21, 5:25 am, Ozzy OG Kush <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I am having this same exact problem! I'm using CakePHP 1.1.19.6305 .
>
> > This is very frustrating! Any help would be very appreciated.
>
> > On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote:
>
> > > Did you ever find a solution to this?  I think I am experiencing a
> > > similar problem.  I can write to a session variable, but I can only
> > > read the valid value if I do so before the action completes.  Once the
> > > action completes and a new one is called, the session information is
> > > gone.  I am extremely new to cake and would love to know the solution.
> > > Thanks!
>
> > > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote:
>
> > > > I still have not succeded in this... The strange thing is that im
> > > > using the Auth component, and im pretty sure It usessessions. What I
> > > > dont know if it uses them with $_SESSION or with thesession
> > > > component, but I would bet for the second.
>
> > > > Quite strange.. I'll try in other cake instalations around and see.
>
> > > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi, thanks! here it is:
>
> > > > > Configure::write('Session.save', 'php'); //also tried with 'cake'
> > > > > Configure::write('Session.cookie', 'CAKEPHP');
> > > > > Configure::write('Session.timeout', '120');
> > > > > Configure::write('Session.start', true);
> > > > > Configure::write('Session.checkAgent', true); //also tried with false
> > > > > Configure::write('Security.level', 'low');
>
> > > > > Right now im asigning with $_SESSION and reading withSession
> > > > > Component :D hahahah
>
> > > > > Thanks for the help!
>
> > > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > > How is your core.php configured? Post what you have for all
> > > > > > Configure::write('Session.*', '...') and whether they are 
> > > > > > uncommented
> > > > > > or not.
>
> > > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> 
> > > > > > wrote:
>
> > > > > > >  Hi. Im having a strange problem, and couldn't find any solution 
> > > > > > > or
> > > > > > >  anyone with a similar problem... Its quite simple:
>
> > > > > > >  same controller, 2 methods:
>
> > > > > > >  function sessionWriteTest ($key, $value) {
> > > > > > >         $this->Session->write($key, $value);
> > > > > > >  }
> > > > > > >  function sessionReadTest ($key) {
> > > > > > >         debug($this->Session->read($key));
> > > > > > >  }
>
> > > > > > >  doesnt work...
>
> > > > > > >  modifying the method sessionWriteTest like this, works:
> > > > > > >  function sessionWriteTest ($key, $value) {
> > > > > > >         $_SESSION[$key] = $value;
> > > > > > >  }
>
> > > > > > >  Am I missing something really simple? My config is set quite 
> > > > > > > default,
> > > > > > >  temp directories are chmod 777, and normalsessionhandling works!
>
> > > > > > >  Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why no "powered by" logo?

2008-06-10 Thread Smelly_Eddie

All very good points.  I can certainly respect giving back to the
community as you have done, and applaud those efforts.

I suppose everyone has their own means of support.  I think I like the
idea of 'movie credits' though you make a good point, that it would be
obnoxious on every page.

But it is a good analogy in movies that somewhere, everyone is given
credit, down to the very camera lens and films used!  I think a
separate  page outlining these details may be the direction I move.

Thanks for your response, I certainly did not mean to belittle anyone,
and apologize if it is taken that way.



On Jun 10, 10:18 am, RichardAtHome <[EMAIL PROTECTED]> wrote:
> Also worth noting: Some clients have a distinct brand that must be
> followed explicitly and a cakephp logo is not part of their branding.
>
> There is also the issue of hacking. If there is a known (and
> unpatched) issue in CakePHP and you stamp 'made with cakephp' across
> your site then you are giving the hacker a free pass.
>
> Not suggesting for a moment there are any holes in cake, but this is
> exactly the reason why a lot of sites hide information about their
> back end.
>
> There's also nothing stopping you (apart from a client request not
> to), writing a blog article about how the site was built that points
> to the site in question ;-)
>
> On Jun 10, 2:43 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
>
> > > So many sites though, (like those found in the 'CakePHP in the wild'
> > > page) have stripped the logo out, and leave no credit or
> > > acknowledgment to the foundation.
>
> > We take them out because we build sites that are about the solution,
> > not the tools we use to build them. It's the same reason you won't
> > find badges for Linux, Apache, PHP, MySQL, the ISP, the web designer,
> > the web developer, the UX designer, the W3C etc. Everybody along the
> > line has a hand in the site and having the equivalent of movie credits
> > at the bottom of every page would be distracting and is unnecessary.
>
> > Two alternatives:
>
> > 1. Include a link that links to a page about how the site is put
> > together. Some people are genuinely interested in this. "Curious about
> > how this site is built?" that kind of thing.
>
> > 2. Donate back to the CakePHP community by helping others, working on
> > docs, test cases or donating cold hard cash (I've tried to do all of
> > those).
>
> > Lastly, there's nothing wrong with keeping the badge on as you have
> > and by all means, continue to do so. But be careful in deriding the
> > rest of us for not doing so.
>
> > Thanks for your continued support of CakePHP!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



UTF-8 : I don't get it !

2008-06-10 Thread Pierre MARCOURT
Hi,

I have just uploaded my CakePHP project on a remote server but I meet an 
issue.
In all my views, I get the text "  " on the top.
I know this is a problem (on FF) regarding to the character encoding 
(cf. 
http://groups.google.com/group/cake-php/browse_thread/thread/28f129e2d31ea263) 
but in local, I don't have this problem !
Moreover, in my default.thtml layout I set the character encoding thanks 
to : charsetTag('UTF-8')."\n"; ?>
If I look at the source code, I have the meta UTF-8 defined.
But if I check the character encoding of my FF browser, it is : Western 
(ISO-8859-1).
Plus, it is working well on IE 7 and Safari 3.1.1.
Finally in my editor : Dreamweaver (Sorry, cf 
http://groups.google.ch/group/cake-php/browse_thread/thread/392484f521fd3f87/aca9db69f8f18aca?lnk=raot)
 
I have set up character encoding at UTF-8 without BOMs.

Please help me because I don't have more idea to fix this.

Regards,

-- 
 *Pierre MARCOURT*  
 
*IT Department* 
*CableOrganizer.com*
5610 NW 12th Ave, suite 214
Fort Lauderdale, FL 33304
 


Phone: 954-861-6310
Fax: 954-861-2001


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



Re: Shouldn't we use SSL when reading cookies as well as writing them?

2008-06-10 Thread aranworld

Thank you!  Sorry ... I guess this had nothing to do with CakePHP.

On Jun 9, 11:34 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> http://cookies.lcs.mit.edu/sslflag.html
>
> > One of the values in a cookie is the SSL? bit. If this bit is set to  
> > true, then the cookie will only be sent back to the server over a  
> > connection which is encrypted with SSL. If it is set to false, the  
> > cookie will be sent whenever the user visits the domain.
>
> On 10 Jun 2008, at 14:44, aranworld wrote:
>
>
>
> > So, the secure flag gets set in the cookie itself and ensures that the
> > cookie is only ever read over a secure connection?
>
> > PHP Manual says:
>
> > When set to TRUE, the cookie will only be set if a secure connection
> > exists.
> > The default is FALSE. On the server-side, it's on the programmer to
> > send this
> > kind of cookie only on secure connection (e.g. with respect to
> > $_SERVER["HTTPS"]).
>
> > This last part about it being "on the programmer" is what confuses
> > me.  This suggests to me that the "secure" parameter only applies to
> > the setting of a cookie, but that I, the programmer, have to do
> > something on my end to continue to keep it secure after it is set.
>
> > -Aran
>
> > On Jun 9, 10:07 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> >> Because the browser won't hand the cookie back to Cake over a non-SSL
> >> connection anyway if it's been set as secure cookie(?).
>
> >> On 10 Jun 2008, at 13:57, aranworld wrote:
>
> >>> In the cookie component there is:
>
> >>> $secure = false
>
> >>> If set to true, it will only allow you to write a cookie if the
> >>> connect is through an HTTPS connection.
>
> >>> But this flag has no impact on reading cookies.  The component
> >>> provides not method for ensuring that a cookie is only read under an
> >>> SSL connection.
>
> >>> Am I misunderstanding something?  If we secure the writing of the
> >>> cookie, don't we also need to secure the reading of that same cookie
> >>> to prevent hijacking?
>
> >>> Can someone explain why this SSL check for reading cookies isn't in
> >>> the Component code?
>
> >>> -Aran
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Why no "powered by" logo?

2008-06-10 Thread RichardAtHome

Also worth noting: Some clients have a distinct brand that must be
followed explicitly and a cakephp logo is not part of their branding.

There is also the issue of hacking. If there is a known (and
unpatched) issue in CakePHP and you stamp 'made with cakephp' across
your site then you are giving the hacker a free pass.

Not suggesting for a moment there are any holes in cake, but this is
exactly the reason why a lot of sites hide information about their
back end.

There's also nothing stopping you (apart from a client request not
to), writing a blog article about how the site was built that points
to the site in question ;-)

On Jun 10, 2:43 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
> > So many sites though, (like those found in the 'CakePHP in the wild'
> > page) have stripped the logo out, and leave no credit or
> > acknowledgment to the foundation.
>
> We take them out because we build sites that are about the solution,
> not the tools we use to build them. It's the same reason you won't
> find badges for Linux, Apache, PHP, MySQL, the ISP, the web designer,
> the web developer, the UX designer, the W3C etc. Everybody along the
> line has a hand in the site and having the equivalent of movie credits
> at the bottom of every page would be distracting and is unnecessary.
>
> Two alternatives:
>
> 1. Include a link that links to a page about how the site is put
> together. Some people are genuinely interested in this. "Curious about
> how this site is built?" that kind of thing.
>
> 2. Donate back to the CakePHP community by helping others, working on
> docs, test cases or donating cold hard cash (I've tried to do all of
> those).
>
> Lastly, there's nothing wrong with keeping the badge on as you have
> and by all means, continue to do so. But be careful in deriding the
> rest of us for not doing so.
>
> Thanks for your continued support of CakePHP!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Update to RC1 broke Ajax

2008-06-10 Thread Paul R. Zwiers

Hi,

I upgraded to RC1 yesterday and am using requestHandler to rend a PDF view. 
Everything seems to be working just fine without any changes. It takes the one 
in views/controller/pdf/ as requested.

Just my 2c :)
Regards,
Paul

> -Original Message-
> From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Sébastien Charrier
> Sent: Tuesday, June 10, 2008 2:18 PM
> 
> Hi.
> 
> Don't know if it's related, but i think RC1 broke RequestHandler
> initialisation. In fact, https://trac.cakephp.org/ticket/4000 seems to
> have to be reopened : requesthandler->initialize()  isn't called
> before requesthandler->startup(), so it always takes the standard
> view.ctp (and not the views/[controller]/[request_type]/view.ctp as it
> should).



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



Re: 503 5.5.2 Send hello first (email component)

2008-06-10 Thread BrendonKoz

You could also use the Zend framework's email classes as a vendor if
need be.  Before the Cake email component was created, that was what
my original plan was for sending email.  There are plenty of tutorials
on using the Zend Framework's email class.  (Don't think of the Zend
Framework as a competitor if you've already chosen Cake.  Cake is a
full stack framework, Zend is a skeletal framework, you can and should
use it where and when you can.)


On Jun 10, 9:46 am, "Jonathan Snook" <[EMAIL PROTECTED]> wrote:
> > I am trying to use the new email component in cake 1.2, but am having
> > problems using it with an authenticated SMTP server. I am getting the
> > following error:
> > 503 5.5.2 Send hello first
>
> Not to knock the core developers but the email component still needs
> some work, especially in support for SMTP extensions like AUTH. My
> recommendation would be to use SwiftMailer (there are CakePHP
> components which a google search is likely to uncover but I'm too lazy
> to do myself).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Strict or Pretty? We're looking for a few good opinions

2008-06-10 Thread BrendonKoz

Wow, you learn something new every day.  Tell George he has huge a
fan.  :)

On Jun 9, 7:10 pm, Nate <[EMAIL PROTECTED]> wrote:
> On Jun 9, 3:41 pm, BrendonKoz <[EMAIL PROTECTED]> wrote:
>
> > Therefore, Chris Schifflet, OmniTI, and perhaps Ilia
> > Alshanetsky would be some contacts that would give some greater
> > insight in to what may be acceptable losses and/or gains for the
> > project.
>
> Which is convenient, since I work for OmniTI and Chris Shiflett (no
> "c") is 4 desks away from me. ;-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Testing custom model methods that are using model associations

2008-06-10 Thread strangy

What is the preferred way of testing associations/relations in custom
model methods?
When testing a model I make a test model class that inherits from the
original model class. I use $this->name in all my custom model methods
when I need to get the model name for the conditions. Now if I use
associations in those methods i don't know how to test them. Do I need
to redefine the $hasMany, $hasManyAndBelongsTo & $belongsTo in my test
model or is there another way.

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



Re: 503 5.5.2 Send hello first (email component)

2008-06-10 Thread Jonathan Snook

> I am trying to use the new email component in cake 1.2, but am having
> problems using it with an authenticated SMTP server. I am getting the
> following error:
> 503 5.5.2 Send hello first

Not to knock the core developers but the email component still needs
some work, especially in support for SMTP extensions like AUTH. My
recommendation would be to use SwiftMailer (there are CakePHP
components which a google search is likely to uncover but I'm too lazy
to do myself).

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



Re: Why no "powered by" logo?

2008-06-10 Thread Jonathan Snook

> So many sites though, (like those found in the 'CakePHP in the wild'
> page) have stripped the logo out, and leave no credit or
> acknowledgment to the foundation.

We take them out because we build sites that are about the solution,
not the tools we use to build them. It's the same reason you won't
find badges for Linux, Apache, PHP, MySQL, the ISP, the web designer,
the web developer, the UX designer, the W3C etc. Everybody along the
line has a hand in the site and having the equivalent of movie credits
at the bottom of every page would be distracting and is unnecessary.

Two alternatives:

1. Include a link that links to a page about how the site is put
together. Some people are genuinely interested in this. "Curious about
how this site is built?" that kind of thing.

2. Donate back to the CakePHP community by helping others, working on
docs, test cases or donating cold hard cash (I've tried to do all of
those).

Lastly, there's nothing wrong with keeping the badge on as you have
and by all means, continue to do so. But be careful in deriding the
rest of us for not doing so.

Thanks for your continued support of CakePHP!

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



HABTM save problem

2008-06-10 Thread Kyle Decot

When trying to save my data, i get a 0 for team_id, but the user_id
saves fine. Any thoughts of what could be wrong?

$this->data['Team']['Team']['team_id'] = 303;
$this->data['User']['User']['user_id'] = $this->Auth->user("id");
$this->Team->create($this->data);
$this->Team->save();

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



Re: Page titles that read well

2008-06-10 Thread grigri

It works fine; looks like your variables are mixed-up.

You've got `var $friendlyName=...` in the model and `$model-
>friendlyDisplay` in the controller.

If this *still* doesn't work, try using `$this->{$this->modelClass}-
>name` first:

[1] $friendlyName does not work, $name does : variable name typo
[2] Neither work : model name typo [make sure the primary model is
first if you're using uses()]

Must say though; if you stuck to cake conventions and called your
model 'CustomerProductReview' (table: customer_product_reviews) then
it would be compatible with Inflector::humanize() which is what the
bake script [and scaffolding] use. Of course if your friendly name is
to be more complicated than simply adding spaces, this is irrelevant.

On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Doesnt seem to work
>
> My controller
>
> class CustomerproductreviewsController extends AppController {
>
> var $name = 'Customerproductreviews';
> var $uses = array('Customerproductreview', 'Product',
> 'Rating','User');
> var $helpers = array('Html',
> 'Form','Pagination','Ajax','FlashChart');
> var $components = array
> ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> function beforeFilter(){
> $this->pageTitle= 
> $this->{$this->modelClass}->friendlyDisplay.'
> - .:: The GreenLife List ::. ';
>
> }
> 
>
> my model
>
> class Customerproductreview extends AppModel
> {
> var $name = 'Customerproductreview';
> var $friendlyName = 'Customer Product Reviews';
> var $validate = array(
> 'title' => VALID_NOT_EMPTY,
> 'product' => VALID_NUMBER,
> 'rating' => VALID_NUMBER,
> 'reason' => VALID_NOT_EMPTY,
> );
> var $displayField = 'title';
> var $recursive = 2;
> .
>
> Am I missing something?
>
> On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > class Pie extends AppModel {
> >   var $friendlyName = 'A tasty treat!';
>
> >   var $actsAs = array('Tasty'); // Optional
>
> > }
>
> > class AppController extends Controller {
> >   function beforeFilter() {
> > if (!empty($this->modelClass)) {
> >   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > - foood');
> > }
> >   }
>
> > }
>
> > Although... some might question the wisdom of setting a view-level
> > parameter in the controller and the model.
>
> > hth
> > grigri
>
> > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > I have always used the function below in my controllers to set the
> > > page's title.
>
> > > function beforeFilter(){
> > > $this->pageTitle= $this->name.' - .:: The GreenLife List 
> > > ::. ';
>
> > > }
>
> > > The problem is that some model names are concatenated due to their
> > > HABTM nature, like "customerproductreviews"
>
> > > I thought I could just set a variable in the Model like
> > > '$displayName',  but the controllers don't see such a variable.
>
> > > I know there must be a way to assign readable and formatted model
> > > names to use in the page title.
>
> > > It wold also be useful when other models read related data, the bake
> > > script could show "related customer reviews" in my other models,
> > > rather than the ugly one word name.
>
> > > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Page titles that read well

2008-06-10 Thread the_woodsman

Erm, friendlyDisplay versus friendlyName?

Of course, if your models were mixed / camel case, you could just use
the inflector and php functions to achieve this... :)

Personally, I think it's okay to let the controller attempt this bit
of view logic, seeing as the views can override it if they have reason
to - it's just a useful default.
I usually go for putting this in beforeRender, using a prettified
version of $this->action (add/edit etc) and  then the model or
controller name.


On Jun 10, 2:27 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Doesnt seem to work
>
> My controller
>
> class CustomerproductreviewsController extends AppController {
>
> var $name = 'Customerproductreviews';
> var $uses = array('Customerproductreview', 'Product',
> 'Rating','User');
> var $helpers = array('Html',
> 'Form','Pagination','Ajax','FlashChart');
> var $components = array
> ('Glscore','Autoformat','RequestHandler','Upload','Pagination');
>
> function beforeFilter(){
> $this->pageTitle= 
> $this->{$this->modelClass}->friendlyDisplay.'
> - .:: The GreenLife List ::. ';
>
> }
> 
>
> my model
>
> class Customerproductreview extends AppModel
> {
> var $name = 'Customerproductreview';
> var $friendlyName = 'Customer Product Reviews';
> var $validate = array(
> 'title' => VALID_NOT_EMPTY,
> 'product' => VALID_NUMBER,
> 'rating' => VALID_NUMBER,
> 'reason' => VALID_NOT_EMPTY,
> );
> var $displayField = 'title';
> var $recursive = 2;
> .
>
> Am I missing something?
>
> On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
>
> > class Pie extends AppModel {
> >   var $friendlyName = 'A tasty treat!';
>
> >   var $actsAs = array('Tasty'); // Optional
>
> > }
>
> > class AppController extends Controller {
> >   function beforeFilter() {
> > if (!empty($this->modelClass)) {
> >   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> > - foood');
> > }
> >   }
>
> > }
>
> > Although... some might question the wisdom of setting a view-level
> > parameter in the controller and the model.
>
> > hth
> > grigri
>
> > On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > > I have always used the function below in my controllers to set the
> > > page's title.
>
> > > function beforeFilter(){
> > > $this->pageTitle= $this->name.' - .:: The GreenLife List 
> > > ::. ';
>
> > > }
>
> > > The problem is that some model names are concatenated due to their
> > > HABTM nature, like "customerproductreviews"
>
> > > I thought I could just set a variable in the Model like
> > > '$displayName',  but the controllers don't see such a variable.
>
> > > I know there must be a way to assign readable and formatted model
> > > names to use in the page title.
>
> > > It wold also be useful when other models read related data, the bake
> > > script could show "related customer reviews" in my other models,
> > > rather than the ugly one word name.
>
> > > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Page titles that read well

2008-06-10 Thread Smelly_Eddie

Doesnt seem to work


My controller

class CustomerproductreviewsController extends AppController {

var $name = 'Customerproductreviews';
var $uses = array('Customerproductreview', 'Product',
'Rating','User');
var $helpers = array('Html',
'Form','Pagination','Ajax','FlashChart');
var $components = array
('Glscore','Autoformat','RequestHandler','Upload','Pagination');





function beforeFilter(){
$this->pageTitle= $this->{$this->modelClass}->friendlyDisplay.'
- .:: The GreenLife List ::. ';

}



my model


class Customerproductreview extends AppModel
{
var $name = 'Customerproductreview';
var $friendlyName = 'Customer Product Reviews';
var $validate = array(
'title' => VALID_NOT_EMPTY,
'product' => VALID_NUMBER,
'rating' => VALID_NUMBER,
'reason' => VALID_NOT_EMPTY,
);
var $displayField = 'title';
var $recursive = 2;
.



Am I missing something?

On Jun 10, 8:56 am, grigri <[EMAIL PROTECTED]> wrote:
> class Pie extends AppModel {
>   var $friendlyName = 'A tasty treat!';
>
>   var $actsAs = array('Tasty'); // Optional
>
> }
>
> class AppController extends Controller {
>   function beforeFilter() {
> if (!empty($this->modelClass)) {
>   $this->set('title', $this->{$this->modelClass}->friendlyName . '
> - foood');
> }
>   }
>
> }
>
> Although... some might question the wisdom of setting a view-level
> parameter in the controller and the model.
>
> hth
> grigri
>
> On Jun 10, 1:37 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
>
> > I have always used the function below in my controllers to set the
> > page's title.
>
> > function beforeFilter(){
> > $this->pageTitle= $this->name.' - .:: The GreenLife List 
> > ::. ';
>
> > }
>
> > The problem is that some model names are concatenated due to their
> > HABTM nature, like "customerproductreviews"
>
> > I thought I could just set a variable in the Model like
> > '$displayName',  but the controllers don't see such a variable.
>
> > I know there must be a way to assign readable and formatted model
> > names to use in the page title.
>
> > It wold also be useful when other models read related data, the bake
> > script could show "related customer reviews" in my other models,
> > rather than the ugly one word name.
>
> > Any help?, yes I have tried google, but what to search?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



View this page "Optimizing Cake's Performance"

2008-06-10 Thread Smelly_Eddie



Click on 
http://groups.google.com/group/cake-php/web/optimizing-cakes-performance?hl=en
- or copy & paste it into your browser's address bar if that doesn't
work.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



programmer requires for project

2008-06-10 Thread Koyok Toindet
Hi There.

I spent a plenty of time in on-line business research and IT development.
I had great success and great lose too, right now I successfully run my last
developed system.
I am an investor and businessman and trainer for success, technical
investment (trading and stock exchange strategies, real estate strategies,
building business and company strategies) and different financial
strategies.

I am about to start a new project and I need a creative programmer team.
The offer for the successful candidates is more than a job, but a share in
the company and from
the copy rights and even more, what you can know later.
I need partners more than employees, so if you are quick enough to take this
chance you can be even one of those students of mine who are already
millionaires  and running their own companies.

The project is about to build and develop a website based on php or java
languages.
Payment conditions according to agreement.

If you are interested send your CV with references to me in e-mail.

Thank you for your attention,
yours,
Koyok

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



Re: Update to RC1 broke Ajax

2008-06-10 Thread Sébastien Charrier

Hi.

Don't know if it's related, but i think RC1 broke RequestHandler
initialisation. In fact, https://trac.cakephp.org/ticket/4000 seems to
have to be reopened : requesthandler->initialize()  isn't called
before requesthandler->startup(), so it always takes the standard
view.ctp (and not the views/[controller]/[request_type]/view.ctp as it
should).

In my case, i just add that in my app_controller.php :
function beforeFilter {
  $this->RequestHandler->initialize($this);
  $this->RequestHandler->startup($this);
}

And it works. Can anyone confirm that there's a regression ? Wanna be
sure before reactivating the ticket.

Thanks,
Sebastien


On Jun 9, 11:12 am, Crazy <[EMAIL PROTECTED]> wrote:
> Hi,
>
> A while ago I took on the challenge to get some ajax stuff to work
> with cake.
> I was able to get it working the way I wanted, but now, by updating to
> the latest version it doesn't work anymore.
>
> Did something releated to ajax change?
> The problem I get is that the default layout is rendered, the the
> entire page is displayed in my div
>
> This is what I have in my controller:
>
>    var $components = array('RequestHandler');
>    var $helpers = array('Html', 'Javascript', 'Ajax');
>
>   function output(){
>     $this->set("result", $this->Shoutbox->findAll(null, null, "date
> DESC", 25, null, false));
>     $this->render("output", "ajax");
>   }
>
> When searching the net I also tried to add this:
>     function beforeFilter(){
>       if($this->RequestHandler->isAjax()){
>       Configure::write('debug', 0);// and forget debug messages
>       $this->layout = ''; //or try with $this->layout = '';
>    }
>
> }
>
> When trying to look for the cause I found that when I did "svn update"
> it stopped working.
>
> Hope someone knows the awnser
>
> Thanks,
> Crazy

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



Re: Session problem

2008-06-10 Thread koko

Anybody found a solution to this  ?? I am having the exact same
problem here !!

On May 21, 5:25 am, Ozzy OG Kush <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I am having this same exact problem! I'm using CakePHP 1.1.19.6305 .
>
> This is very frustrating! Any help would be very appreciated.
>
> On Apr 23, 11:45 am, creationsings <[EMAIL PROTECTED]> wrote:
>
> > Did you ever find a solution to this?  I think I am experiencing a
> > similar problem.  I can write to a session variable, but I can only
> > read the valid value if I do so before the action completes.  Once the
> > action completes and a new one is called, the session information is
> > gone.  I am extremely new to cake and would love to know the solution.
> > Thanks!
>
> > On Apr 17, 3:03 pm, Ramiro Araujo <[EMAIL PROTECTED]> wrote:
>
> > > I still have not succeded in this... The strange thing is that im
> > > using the Auth component, and im pretty sure It usessessions. What I
> > > dont know if it uses them with $_SESSION or with thesession
> > > component, but I would bet for the second.
>
> > > Quite strange.. I'll try in other cake instalations around and see.
>
> > > On Apr 15, 10:38 am, Ramiro Araujo <[EMAIL PROTECTED]> wrote:
>
> > > > Hi, thanks! here it is:
>
> > > > Configure::write('Session.save', 'php'); //also tried with 'cake'
> > > > Configure::write('Session.cookie', 'CAKEPHP');
> > > > Configure::write('Session.timeout', '120');
> > > > Configure::write('Session.start', true);
> > > > Configure::write('Session.checkAgent', true); //also tried with false
> > > > Configure::write('Security.level', 'low');
>
> > > > Right now im asigning with $_SESSION and reading withSession
> > > > Component :D hahahah
>
> > > > Thanks for the help!
>
> > > > On Apr 14, 3:58 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>
> > > > > How is your core.php configured? Post what you have for all
> > > > > Configure::write('Session.*', '...') and whether they are uncommented
> > > > > or not.
>
> > > > > On Mon, Apr 14, 2008 at 1:35 PM,RamiroAraujo <[EMAIL PROTECTED]> 
> > > > > wrote:
>
> > > > > >  Hi. Im having a strange problem, and couldn't find any solution or
> > > > > >  anyone with a similar problem... Its quite simple:
>
> > > > > >  same controller, 2 methods:
>
> > > > > >  function sessionWriteTest ($key, $value) {
> > > > > >         $this->Session->write($key, $value);
> > > > > >  }
> > > > > >  function sessionReadTest ($key) {
> > > > > >         debug($this->Session->read($key));
> > > > > >  }
>
> > > > > >  doesnt work...
>
> > > > > >  modifying the method sessionWriteTest like this, works:
> > > > > >  function sessionWriteTest ($key, $value) {
> > > > > >         $_SESSION[$key] = $value;
> > > > > >  }
>
> > > > > >  Am I missing something really simple? My config is set quite 
> > > > > > default,
> > > > > >  temp directories are chmod 777, and normalsessionhandling works!
>
> > > > > >  Thanks!

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



Re: Using Cake's core Xml class in a controller method?

2008-06-10 Thread avairet

Thanks a lot grigri!

I never think to check out tests files to understand usage...
And sometimes, the logic to call a Cake's core lib is different, for
example if I want to call "extract()" from Set class, I can do a
static call... but for Xml I can't!

BR




On 10 juin, 14:42, grigri <[EMAIL PROTECTED]> wrote:
> Check out the Xml test files (cake/tests/cases/libs/xml.test.php) for
> usage
>
> * Use App::import('Core', 'Xml');
> * You need to instanciate an Xml object; you can't call it statically
>   (since you called it statically from inside your controller, the `
> $this` references inside correspond to the controller)
> * Xml's constructor detects if the string is a path or raw xml and
> handles it correctly
>
> so...
>
> function some_method() {
>   App::import('Core', 'Xml');
>   $channel = '';
>   $xml = new Xml($channel);
>   var_dump($xml);
>
> }
>
> hth
> grigri
>
> On Jun 10, 1:27 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I'm trying to use the Xml class in a controller like that :
>
> > public function MyMethod() {
> >  App::import('Xml');
> >  $channel = 'http://www.mywebsite.com/my_web_services/channel.php?
> > ste_id=123456';
> >  $doc = Xml::load($channel);
> >  var_dump($doc);
>
> > }
>
> > But var_dump is not displayed because of a PHP error:
>
> > Fatal error: Call to undefined method MyController::parse() in D:
> > \developpements\frameworks\cake\actinext_2\cake\libs\xml.php on line
> > 773
>
> > Is it a Cake's core bug or an personnal error?
>
> > Thks by advance for ideas about this issue.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



  1   2   >