Media Plugin begginer problems....

2012-03-16 Thread avairet
Hi,

I'm trying to use David Person's Media Plugin with an hasMany association 
and it doesn't work...
My environment:
- Win XP
- CakePHP 1.3.14
- PHP 5.3.8
- Media Plugin 1.3

Media plugin is in my App/plugins directory.
In my config/boostrap.php, I have: "require 
APP.'plugins/media/config/core.php"
I've created a model called "Attachment", with a database table 
"attachmentes" defined like that:
ID
model
foreign_key
dirname
basename
checksum
alternative
group
created
modified

In Attachement Model, I've defined the behavior like that:
public $actsAs = array('Media.Transfer','Media.Coupler').

In a Apartment Model, I've defined an hasMany association like that:
public $hasMany = array('Photo' => array(
'className' => 'Media.Attachment',
'foreignKey' => 'foreign_key',
'dependent' => true,
'conditions' => array('Photo.model' => 'Apartment'),
));

In a Apartment edit view I've my form defined like that:
Form->create('Apartment',array('type'=>'file','action'=>'edit_photos')); 
?>
Form->input('Apartment.id'); ?>
Form->hidden('Attachment.0.model',array('value'=>'Apartment')); ?>
Form->end(__('Save',true)); ?>

And finally, in my edit_photos method, I make a saveAll() like that:
$this->Apartment->saveAll($this->data, array('validate' => 'first'));

When I submit a valid file (a real jpg image), the saveAll return true, but 
no file is uploaded in "webroot/media/transfer/img" directory and there is 
no record saved in my "attachments" table...

I've tried to define an belongsTo association with Apartment in Attachment 
model, no success.
I've tried to just using "Media.Tranfer", no success.
What I miss?!

thanks by advance for any help.

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


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


Cake Bake issu under PHP 5.3.10?

2012-03-12 Thread avairet
Does anybody have problem with Cake bake under PHP 5.3.10?

I'm using Cakephp 1.3.14 on WinXP and I've no problem until installing
PHP 5.3.10.

In fact, I can't launching Cake Bake: I've got always an "PHP Cli
error"?!

I can launching Cake i18n, Cake api, etc. even Cake media init (Media
Plugin) or Cake benchmark (Debug kit), without problem. But a simple
"cake bake" fails...

I've reinstalled a PHP 5.3.8 version and everything is good. But I
must use 5.3.10 for a project, cause of secure environment...

Any idea is welcome ;)

BR

Avairet

PS : sorry for my simple English...

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


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


Re: Strange updateCounterCache behavior

2011-12-09 Thread avairet
No, it's an error. My fields are really INT(11).
I'm using Cake since 4 years and using counterCache well.


On 9 déc, 17:28, Jeremy Burns | Class Outfit
 wrote:
> Your mail said:
>
> In my personalities and categories tables, I have a
> "personality_count" field (TINYINT).
>
> Are you sure?
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 9 Dec 2011, at 16:17:33, avairet wrote:
>
> > Oh non sorry :)
> > personality_count fields are INT(11)
>
> > On 9 déc, 17:15, avairet  wrote:
> >> Like I said : TINYINT(1)
>
> >> On 9 déc, 17:11, Jeremy Burns | Class Outfit
>
> >>  wrote:
> >>> What's the data type and size of the counter fields?
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>>http://www.classoutfit.com
>
> >>> On 9 Dec 2011, at 16:07:53, avairet wrote:
>
> >>>> Hi,
>
> >>>> I'm using Cake 1.3.13.
>
> >>>> I have an strange issue with counterCache, that I've never seen
> >>>> before.
>
> >>>> So, I have Personality belongsTo User and Personality belongsTo
> >>>> Category associations:
>
> >>>>    public $belongsTo = array(
> >>>>            'Category' => array(
> >>>>                    'className' => 'Category',
> >>>>                    'foreignKey' => 'category_id',
> >>>>                    'conditions' => '',
> >>>>                    'fields' => '',
> >>>>                    'order' => '',
> >>>>                    'counterCache' => true,
> >>>>                    'counterScope' => array('Personality.valid' => 1)
> >>>>            ),
> >>>>            'User' => array(
> >>>>                    'className' => 'User',
> >>>>                    'foreignKey' => 'user_id',
> >>>>                    'conditions' => '',
> >>>>                    'fields' => '',
> >>>>                    'order' => '',
> >>>>                    'counterCache' => true,
> >>>>                    'counterScope' => array('Personality.valid' => 1)
> >>>>            )
> >>>>    );
>
> >>>> In my personalities and categories tables, I have a
> >>>> "personality_count" field (TINYINT).
> >>>> When I add a Personality and I set "valid" to 1, all is right, the
> >>>> counters are updated.
>
> >>>> In my personality edit view, I have a checkbox to validate or
> >>>> invalidate the record (Personality.valid = 0 or 1).
> >>>> If I invalidate a personality, all is right, the counters are updated
> >>>> (- 1).
> >>>> But after that, if I validate the personality again, the counters
> >>>> don't change?!
>
> >>>> What's the mistake? Thank's fo any idea.
>
> >>>> By the way, why there is a "$created" param in
> >>>> Model::updateCounterCache() while it is never used inside the method??
>
> >>>> Avairet
>
> >>>> --
> >>>> Our newest site for the community: CakePHP Video 
> >>>> Tutorialshttp://tv.cakephp.org
> >>>> Check out the new CakePHP Questions 
> >>>> sitehttp://ask.cakephp.organdhelpothers with their CakePHP related 
> >>>> questions.
>
> >>>> To unsubscribe from this group, send email to
> >>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php
>
>

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


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


Re: Strange updateCounterCache behavior

2011-12-09 Thread avairet
Oh non sorry :)
personality_count fields are INT(11)

On 9 déc, 17:15, avairet  wrote:
> Like I said : TINYINT(1)
>
> On 9 déc, 17:11, Jeremy Burns | Class Outfit
>
>  wrote:
> > What's the data type and size of the counter fields?
>
> > Jeremy Burns
> > Class Outfit
>
> >http://www.classoutfit.com
>
> > On 9 Dec 2011, at 16:07:53, avairet wrote:
>
> > > Hi,
>
> > > I'm using Cake 1.3.13.
>
> > > I have an strange issue with counterCache, that I've never seen
> > > before.
>
> > > So, I have Personality belongsTo User and Personality belongsTo
> > > Category associations:
>
> > >    public $belongsTo = array(
> > >            'Category' => array(
> > >                    'className' => 'Category',
> > >                    'foreignKey' => 'category_id',
> > >                    'conditions' => '',
> > >                    'fields' => '',
> > >                    'order' => '',
> > >                    'counterCache' => true,
> > >                    'counterScope' => array('Personality.valid' => 1)
> > >            ),
> > >            'User' => array(
> > >                    'className' => 'User',
> > >                    'foreignKey' => 'user_id',
> > >                    'conditions' => '',
> > >                    'fields' => '',
> > >                    'order' => '',
> > >                    'counterCache' => true,
> > >                    'counterScope' => array('Personality.valid' => 1)
> > >            )
> > >    );
>
> > > In my personalities and categories tables, I have a
> > > "personality_count" field (TINYINT).
> > > When I add a Personality and I set "valid" to 1, all is right, the
> > > counters are updated.
>
> > > In my personality edit view, I have a checkbox to validate or
> > > invalidate the record (Personality.valid = 0 or 1).
> > > If I invalidate a personality, all is right, the counters are updated
> > > (- 1).
> > > But after that, if I validate the personality again, the counters
> > > don't change?!
>
> > > What's the mistake? Thank's fo any idea.
>
> > > By the way, why there is a "$created" param in
> > > Model::updateCounterCache() while it is never used inside the method??
>
> > > Avairet
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php
>
>

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


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


Re: Strange updateCounterCache behavior

2011-12-09 Thread avairet
Like I said : TINYINT(1)

On 9 déc, 17:11, Jeremy Burns | Class Outfit
 wrote:
> What's the data type and size of the counter fields?
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 9 Dec 2011, at 16:07:53, avairet wrote:
>
> > Hi,
>
> > I'm using Cake 1.3.13.
>
> > I have an strange issue with counterCache, that I've never seen
> > before.
>
> > So, I have Personality belongsTo User and Personality belongsTo
> > Category associations:
>
> >    public $belongsTo = array(
> >            'Category' => array(
> >                    'className' => 'Category',
> >                    'foreignKey' => 'category_id',
> >                    'conditions' => '',
> >                    'fields' => '',
> >                    'order' => '',
> >                    'counterCache' => true,
> >                    'counterScope' => array('Personality.valid' => 1)
> >            ),
> >            'User' => array(
> >                    'className' => 'User',
> >                    'foreignKey' => 'user_id',
> >                    'conditions' => '',
> >                    'fields' => '',
> >                    'order' => '',
> >                    'counterCache' => true,
> >                    'counterScope' => array('Personality.valid' => 1)
> >            )
> >    );
>
> > In my personalities and categories tables, I have a
> > "personality_count" field (TINYINT).
> > When I add a Personality and I set "valid" to 1, all is right, the
> > counters are updated.
>
> > In my personality edit view, I have a checkbox to validate or
> > invalidate the record (Personality.valid = 0 or 1).
> > If I invalidate a personality, all is right, the counters are updated
> > (- 1).
> > But after that, if I validate the personality again, the counters
> > don't change?!
>
> > What's the mistake? Thank's fo any idea.
>
> > By the way, why there is a "$created" param in
> > Model::updateCounterCache() while it is never used inside the method??
>
> > Avairet
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php
>
>

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


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


Strange updateCounterCache behavior

2011-12-09 Thread avairet
Hi,

I'm using Cake 1.3.13.

I have an strange issue with counterCache, that I've never seen
before.

So, I have Personality belongsTo User and Personality belongsTo
Category associations:

public $belongsTo = array(
'Category' => array(
'className' => 'Category',
'foreignKey' => 'category_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => true,
'counterScope' => array('Personality.valid' => 1)
),
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => true,
'counterScope' => array('Personality.valid' => 1)
)
);

In my personalities and categories tables, I have a
"personality_count" field (TINYINT).
When I add a Personality and I set "valid" to 1, all is right, the
counters are updated.

In my personality edit view, I have a checkbox to validate or
invalidate the record (Personality.valid = 0 or 1).
If I invalidate a personality, all is right, the counters are updated
(- 1).
But after that, if I validate the personality again, the counters
don't change?!

What's the mistake? Thank's fo any idea.

By the way, why there is a "$created" param in
Model::updateCounterCache() while it is never used inside the method??

Avairet

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


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


Custom Session Handler and ini_restore('session.check_referer') does not work

2011-09-07 Thread avairet
Hi there,

I've got some issues with login a user from an external domain,
because of the ini_set('session.check_referer',$this->host) on core
session class.

So I've created my custom session handler file, like example in the
book:
http://book.cakephp.org/view/1310/Sessions

But even with this custom config, referer is checking and my
authentification fails...
The only way to avoid this checking is to turn session level on to
"low" in config/core.php

Have you any idea why the ini_restore('session.referer_check'); does
not work?
I've tried ini_set('session.referer_check', ''); too, without
success...

I'm using Cakephp 1.3.8, PHP Version 5.3.2-1ubuntu4.9.1

Cheers,

Avairet

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


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


Re: Delete translated contents for a Tree Model

2011-09-07 Thread avairet
Hi there,

I've made this in the model which uses the Tree and Translate
behaviors:

// Add a private var in the model, to store children of record to
delete
private $translated_children = array();

// Add callbacks to store children and delete it
public function beforeDelete() {
$children = $this->children($this->id,false,array('id'));
if (!empty($children)) {
$this->translated_children = 
Set::extract('/MyModelName/id',
$children);
}
return true;
}

public function afterDelete() {
if (!empty($this->translated_children)) {
$translateModel = $this->translateModel();
$translateModel->deleteAll(array('model'=>$this-
>alias,'foreign_key'=>$this->translated_children));
}
return true;
}

Maybe we can extends core TranslateBehavior and pass a parameter to
tell the model use TreeBehavior to make this trick.

Avairet

On 1 sep, 17:09, avairet  wrote:
> I'm using TranslateBehavior on a model that is a Tree Model.
>
> When I delete a child node from the Tree, related contents in my i18n
> table are correctly deleted.
> But if I delete a parent node, only related contents for this parent
> node are deleted from the i18n table, translated contents for the
> child nodes are not deleted.
>
> I see that in the afterDelete() method of TranslateBehavior, a
> deleteAll() call is executed, but it take only the current id and it
> didn't make a cascading delete.
>
> Have you an idea to improve that?
>
> Hope my question is clear...
>
> Avairet

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


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


Delete translated contents for a Tree Model

2011-09-01 Thread avairet
I'm using TranslateBehavior on a model that is a Tree Model.

When I delete a child node from the Tree, related contents in my i18n
table are correctly deleted.
But if I delete a parent node, only related contents for this parent
node are deleted from the i18n table, translated contents for the
child nodes are not deleted.

I see that in the afterDelete() method of TranslateBehavior, a
deleteAll() call is executed, but it take only the current id and it
didn't make a cascading delete.

Have you an idea to improve that?

Hope my question is clear...

Avairet

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


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


Re: Add user form has password field filled in by Authenticated user...

2010-07-27 Thread avairet
Ok, it's the Forms History of Firefox that store those informations.
If I delete stored usernames and passwords, then fields in my form are
empty.
But I don't understand why Firefox fills "email" field instead of
"username"?

On 27 juil, 19:06, avairet  wrote:
> Ok, thanks Norman!
> Apparently it's Firefox that fills the field but why "email" and not
> "username"?
> How to avoid this behavior? Because it's disturbing for non-specialist
> users...
>
> avairet
>
> On 27 juil, 18:57, Norman Paniagua  wrote:
>
> > I think it's your browser that fills your field, try to see the html code
> > that it generate and if the value is empty it's your browser, otherwise it's
> > cake
> > ---
>
> > Norman Paniagua
>
> > 2010/7/27 avairet 
>
> > > Hi,
>
> > > I'm using CakePHP 1.3.3 and Firefox 3.6.6 under WinXP.
>
> > > My add user form (in an admin context) has it's password field always
> > > filled in by the Auth password of the connected user, even I write:
> > > value=>'' in the input options.
>
> > > And another very strange behavior on the same form: the email field is
> > > filled in by the user name of the Authenticated user.
>
> > > Here is my code:
> > >http://bin.cakephp.org/view/592173290
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > with their CakePHP related questions.
>
> > > You received this message because you are subscribed to the Google Groups
> > > "CakePHP" group.
> > > To post to this group, send email to cake-php@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.comFor
> > >  more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

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

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


Re: Add user form has password field filled in by Authenticated user...

2010-07-27 Thread avairet
Ok, thanks Norman!
Apparently it's Firefox that fills the field but why "email" and not
"username"?
How to avoid this behavior? Because it's disturbing for non-specialist
users...

avairet

On 27 juil, 18:57, Norman Paniagua  wrote:
> I think it's your browser that fills your field, try to see the html code
> that it generate and if the value is empty it's your browser, otherwise it's
> cake
> ---
>
> Norman Paniagua
>
> 2010/7/27 avairet 
>
> > Hi,
>
> > I'm using CakePHP 1.3.3 and Firefox 3.6.6 under WinXP.
>
> > My add user form (in an admin context) has it's password field always
> > filled in by the Auth password of the connected user, even I write:
> > value=>'' in the input options.
>
> > And another very strange behavior on the same form: the email field is
> > filled in by the user name of the Authenticated user.
>
> > Here is my code:
> >http://bin.cakephp.org/view/592173290
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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

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


Add user form has password field filled in by Authenticated user...

2010-07-27 Thread avairet
Hi,

I'm using CakePHP 1.3.3 and Firefox 3.6.6 under WinXP.

My add user form (in an admin context) has it's password field always
filled in by the Auth password of the connected user, even I write:
value=>'' in the input options.

And another very strange behavior on the same form: the email field is
filled in by the user name of the Authenticated user.

Here is my code:
http://bin.cakephp.org/view/592173290

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

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


Re: Poll: what do you hate about CakePHP?

2009-05-20 Thread avairet

Thank you for this ironic but serious message Nate!
To respect your humoristic formulation, here is my "hateful"
contribution!
And sorry for my simple English… hope it's understandable. ;)

I "hate" the lack of rigor with relational model and SQL norm. I think
"compound primary keys", sub-queries, multi-level JOIN should be
implemented. It will permit to avoid "artificial id" in HABTM for
example and thus tons of intermediate queries. More data types should
be available too (like ENUM and SET for MySQL).

I "hate" contributions constraints like: "Make a Unit Test" when I
report a bug or like: "Fork the project and use Git" when I just want
to update the .po file for CookBook.

I "hate" the instability of official documentation. Yes CookBook is
better than ever, but there are still a lot of sections without
explanations, some with obsolete explanations, others that are
frequently modified… it's difficult for both newcomers and translators
to navigate through it and find the good information. A PDF export –
global or partial - would be useful too

I "hate" translation tool and process for CookBook, it is complex,
heavy to manipulate, frequently modified and debugged. Ok, there were
new features recently developed (thanks to AD7six, Gwoo and others for
this work), but is not enough to attract and motivate new translators…
Two little suggestions for the moment: give validation rights to
locale community AND/OR let us write our own documentation, inspired
by, but not a perfect clone of the original.

I "hate" the multi-communicational channels of community : Bakery,
official website, Ohloh journal, multiple IRC's chans, multiple
GoogleGroups, Trac, TheChaw, CakeFest, unofficial forum, core
developpers and contributors blogs… it's like a puzzle! The
heterogeneity of designs between those different websites of the
Cake's galaxy make it even more disorganized.

In the same way, I "hate" Cake's logo (this cake is more like a cheese
�� ) and official website design (not clear enough, too funny and not
enough serious for deciders in comparison to Symfony and ZF designs).

I hate methods with more than 4 parameters or with mixed parameters (a
string or an array or null).
I hate Cake's shortcuts that just embbed PHP native functions like "e
()", "up()", "low()"… (for the majority of PHP's IDE, autocomplete
works well for that).

I "hate" the limited internationalisation of core methods like
Validate::alphanumeric() or Inflector::slug(). Accented and special
chars should be available and mb_ functions might be used, maybe by
including localized chars files (setting a var in config/core.php for
example). More internationalisation for Validate::phone() or
Validate::ssn() would be great too. We can help you to do that: please
delegate some responsibilities to the numerous dynamic international
communities!

Other opinions that I'm supporting too:
++ PHP 4 to full PHP5 syntax
++ ACL more flexibility (e.g. user attached to two groups)
++ Objects instead arrays, especially for find's returns
++ GUI for Bake, because we're not all CLI gurus… hmmm, ok, we should
be! ��
++ More complete Bake
++ Plugins management
++ Form::error messages
++ Jquery
++ automagic slug field

That's all... for the moment!

OK, I know that a framework can NOT make the coffee and that I can
create my own logic when needed.
But I would like to say that in my point of view, the more Cake will
be professional, industrial and rigorous, the more it will be adopted
by PHP users and deciders who currently look at Symfony or Zend
Framework side, even if Cake is more fun and easy to use.

I like Cake and its philosophy, I want to develop its usage and
recognition around the World, so let’s work together to make a better
Cake! ;)

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



Paginator links and Custom routes

2008-10-15 Thread avairet

Dear All,

I've an issue with custom routing and automagic paginator links...

Here are the patterns I would like for my uris:

http://www.mywebsite.com/petites-annonces/belles-annonces/prix
http://www.mywebsite.com/petites-annonces/belles-annonces/date
http://www.mywebsite.com/petites-annonces/belles-annonces/taille
http://www.mywebsite.com/petites-annonces/professionnels/taille
http://www.mywebsite.com/petites-annonces/professionnels/prix

where "http://www.mywebsite.com/petites-annonces"; is my base uri.

So I've written this route:

Router::connect ('/petites-annonces/:category/:toto',
array
(
'controller'=>'annonces',
'action'=>'listing'
),
array
(
'category' => "professionnels|belles-annonces|particuliers",
'toto' => "date|vue|modele|prix|taille|localisation|rubrique|chantier"
));

And this is my "listing" action in AnnoncesController:

public function listing() {
  $this->Annonce->contain(false,array('PhotoAnnonce(url)'));
  $this->paginate = array
  (
'limit'  => 25,
'order' => 'name ASC',
'conditions' => $conditions,
'fields'  => array('id', 'name', 'year', 'price')
  );
  $this->set('annonces',$this->paginate('Annonce'));
  $this->render('listing','annonces_listing','search_model');
}

Finally, here are 3 ways I've tested to implement my paginator links
in 'views/annonces/search_model.ctp':


first('première
page',array('url'=>$this->params['url']['url'])); ?>
numbers(array('separator'=>'
','modulus'=>10,'url'=>$this->params['category']));?>
last('dernière
page',array('url'=>array($this->params['category'],$this-
>params['toto']));?>


How can I keep this pattern in the paginator links (prev, first,
numbers)?
Because all my tests have failed: the paginator links always contain
"http://www.mywebsite.com/annonces/listing/"; instead of "http://
www.mywebsite.com/petites-annonces"

Thank's for all suggestions...

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



Using COLLATE 'utf8_unicode_ci' for order clause in paginate?

2008-09-26 Thread avairet

Hi,

Is it possible to add a collation clause in a order clause of
paginate() ?

I've tried those different solutions, but no success:

// tags_controller.php

public function admin_index() {
 $this->Tag->recursive = 0;
 $this->paginate = array('order' => 'name COLLATE 'utf8_unicode_ci'
ASC');
 $this->set('tags', $this->paginate());
}

public function admin_index() {
 $this->Tag->recursive = 0;
 $this->paginate = array('order' => 'name ASC',
'collate'=>'utf8_unicode_ci' );
 $this->set('tags', $this->paginate());
}

public function admin_index() {
 $this->Tag->recursive = 0;
 $this->paginate = array('order' => array('name'=> 'ASC'),
'collate'=>'utf8_unicode_ci' );
 $this->set('tags', $this->paginate());
}

Do you think I can do that with a custom paginate() method in my
model?

Thank's by advance for suggestions.

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



How prevent automatic insert User in Aros and Acos table?

2008-09-25 Thread avairet

Hi,

I'm using ACL by groups, with "User belongsTo Group" and bindNode()
method in my User model.
So I don't want to insert new aro when I create a user because the
group permission is sufficient.
Is it possible to disconnect AclBehavior when I add a user?

In fact my User model is both "controlled" and "requester". To do that
I've created an "Acl2Behavior" that just extends the AclBehavior. And
in my model I write this: $actsAs =
array('Acl'=>'controlled','Acl2'=>'requester');

So I've the same problem with Aco's table: an insert in User create an
automatic insert in acos table... How to prevent that?

Any idea is welcome!

BR
--~--~-~--~~~---~--~~
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 session question - for Authentication

2008-09-19 Thread avairet

Hi,

Just an idea for the first issue: put " $this->Auth->allow('add') " in
your "beforeFilter()" function!




On 19 sep, 16:31, gabriel <[EMAIL PROTECTED]> wrote:
> Hi, I have followed the Authentication in the Cookbook. I have a few
> problems, maybe someone can help me. Firstly to 'allow' certain pages,
> I place the $this->Auth->allow('add');  in the Users controller and
> get and error, I have also tried to include it in the add and login
> functions, but it does not seems to work, the error is
>
> Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
> in C:\xampp\htdocs\testsite\app\controllers\users_controller.php on
> line 8
>
> class UsersController extends AppController {
>
>         var $name = 'Users';
>         var $helpers = array('Html', 'Form', 'Session');
>
> // var $components = array('Auth'); //declared in app_controller.php
>
>   $this->Auth->allow('add');
>
> SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
> get all the sessions - see below..I want the user_id, I have tried
> print_r($_SESSION['Config']['User']['id']) which works but when I put
> in the
>
> link("My classified adds ", array("controller" =>
> "items", "action" =>
> "view", ".$_SESSION['Config']['User']['id']).")); ?>
>
> it does not work, any ideas, anyone??? I have tried $session-
>
> >read('id'), which does not work..( in the view)
>
> Array
> (
>     [User] => Array
>         (
>             [id] => 3
>             [username] => test
>             [name] => piet
>             [lname] => test
>             [email] => [EMAIL PROTECTED]
>             [tell] => 123
>             [cell] => 321
>             [hnum] => 2
>             [street] => car
>             [city_id] => 1
>             [county_id] => 2
>             [country_id] => 3
>             [pcode] => mnh
>             [admin] => 7
>             [maillist] => 0
>             [created] => -00-00 00:00:00
>             [modified] => -00-00 00:00:00
>             [ip] => 1
>             [last_visit] => 2011-11-01 00:00:00
>             [group_id] => 1
>             [active] => 0
>             [emailssend] => 0
>             [browser_id] => 1
>             [screen] => 11
>         )
>
> )
> Array
> (
>     [Config] => Array
>         (
>             [userAgent] => a8c0ddfcbb06197967f6ae13f3fdd732
>             [time] => 1221835585
>             [rand] => 21704
>             [timeout] => 10
>         )
>
>     [Message] => Array
>         (
>         )
>
>     [Auth] => Array
>         (
>             [User] => Array
>                 (
>                     [id] => 3
>                     [username] => test
>                     [name] => piet
>                     [lname] => test
>                     [email] => [EMAIL PROTECTED]
>                     [tell] => 123
>                     [cell] => 321
>                     [hnum] => 2
>                     [street] => car
>                     [city_id] => 1
>                     [county_id] => 2
>                     [country_id] => 3
>                     [pcode] => mnh
>                     [admin] => 7
>                     [maillist] => 0
>                     [created] => -00-00 00:00:00
>                     [modified] => -00-00 00:00:00
>                     [ip] => 1
>                     [last_visit] => 2011-11-01 00:00:00
>                     [group_id] => 1
>                     [active] => 0
>                     [emailssend] => 0
>                     [browser_id] => 1
>                     [screen] => 11
>                 )
>
>         )
>
> )
> v
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Cookie and Subdomain / Multiapp

2008-09-19 Thread avairet

Hi,

I've 2 "domains" in my localhost:

1) www.mydomain.com
2) club.mydomain.com

In UsersController of domain number 2), in login() action, I do that:

if ($this->Auth->user()) {
 if (!empty($this->data)) {
  $this->Cookie->write('Auth.User', $this->Auth-
>user('pseudo'),false);
 }
}

in AppController::beforeFilter() of domain number 1), I do that:

$cookie = $this->Cookie->read('Auth.User');
if (!is_null($cookie)) {
 var_dump($cookie);die;
}


In domain 1), $cookie is always empty
In domain 2), it is always full...

I've setted "session.cookie_domain = .mydomain.com" in my PHP.ini, but
it doesn't work...
I've setted "var $cookieDomain = '.mydomain.com' " in AppController,
but it doesn't work

I'm using Cake 1.2 nightly builds, PHP 5.2

How can I read the same Cookie in my 2 subdomains??

Hope this message is understandable and thank's for suggestions...





--~--~-~--~~~---~--~~
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: Trying to use Auth + Acl...

2008-09-10 Thread avairet

Ok, nobody answers...

So, one error I've made is to call AuthComponent before AclComponent
in $components array !
And another error is to not authorize an action called by a
requestAction()...

Hope this help!



On 10 sep, 14:13, avairet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to use Auth Component and Acl Component and Acl Behavior
> like that:
>
> 1) App_controller:
>
> public $components('Auth','Acl');
>
> public beforeFilter() {
>   $this->Auth->userModel = 'User';
>   $this->Auth->fields = array('username' => 'pseudo', 'password' =>
> 'password');
>   $this->Auth->loginAction = 'users/login';
>   $this->Auth->loginRedirect = 'profil/mes-infos';
>   $this->Auth->logoutRedirect = '/';
>   $this->Auth->authorize = 'actions';
>   $this->Auth->loginError = __('Identifiant ou mot de passe
> incorrect.', true);
>   $this->Auth->authError = __('Vous n\'avez pas accès à cette page.
> Veuillez vous identifier.', true);
>   $this->Auth->autoRedirect = true;
>
> }
>
> 2) App_model:
>
> public $actsAs = array (
>   'Acl' => array('type' => 'controlled'),
>   'Containable' => array(true,'notices' => true)
>  );
>
> public function parentNode() {
>   return null;
>
> }
>
> 3) User model:
>
> public $actsAs = array (
>  'Acl' => array('type'=>'requester'),
>  'Containable' => array(true,'notices' => true)
>
> }
>
> public function parentNode() {
>     if (!$this->id && empty($this->data)) {
>         return null;
>     }
>     $data = $this->data;
>     if (empty($this->data)) {
>         $data = $this->read();
>     }
>     if (!$data['User']['group_id']) {
>         return null;
>     } else {
>         return array('Group' => array('id' => $data['User']
> ['group_id']));
>     }
>
> }
>
> 4) Group model:
>
> public $actsAs = array (
>   'Acl' => array('type'=>'requester'),
>   'Containable' => array(true,'notices' => true)
> );
>
> public function parentNode() {
>     if (!$this->id && empty($this->data)) {
>         return null;
>     }
>     $data = $this->data;
>     if (empty($this->data)) {
>         $data = $this->read();
>     }
>     if (!$data['Group']['id']) {
>         return null;
>     } else {
>         return array('Group' => array('id' => $data['Group']['id']));
>     }
>
> }
>
> 5) ExpertsController:
>
> public function beforeFilter() {
>   parent::beforeFilter();
>   $this->Auth->allowedActions = array('index');
>
> }
>
> public function index() {}
>
> So when I request "http://www.mywebsite/experts";, I can't access to
> index() view, there is a infinite loop??!
> And if I request a protected action (e.g. "http://www.mywebsite/
> experts/add", I'm never redirected to login page, there is a infinite
> loop too??!
>
> Do I something wrong in this basic usage of Auth + Acl?
>
> Thank's by advance for any suggestions!
>
> BR
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Trying to use Auth + Acl...

2008-09-10 Thread avairet

Hi,

I'm trying to use Auth Component and Acl Component and Acl Behavior
like that:

1) App_controller:

public $components('Auth','Acl');

public beforeFilter() {
  $this->Auth->userModel = 'User';
  $this->Auth->fields = array('username' => 'pseudo', 'password' =>
'password');
  $this->Auth->loginAction = 'users/login';
  $this->Auth->loginRedirect = 'profil/mes-infos';
  $this->Auth->logoutRedirect = '/';
  $this->Auth->authorize = 'actions';
  $this->Auth->loginError = __('Identifiant ou mot de passe
incorrect.', true);
  $this->Auth->authError = __('Vous n\'avez pas accès à cette page.
Veuillez vous identifier.', true);
  $this->Auth->autoRedirect = true;
}


2) App_model:

public $actsAs = array (
  'Acl' => array('type' => 'controlled'),
  'Containable' => array(true,'notices' => true)
 );

public function parentNode() {
  return null;
}


3) User model:

public $actsAs = array (
 'Acl' => array('type'=>'requester'),
 'Containable' => array(true,'notices' => true)
}

public function parentNode() {
if (!$this->id && empty($this->data)) {
return null;
}
$data = $this->data;
if (empty($this->data)) {
$data = $this->read();
}
if (!$data['User']['group_id']) {
return null;
} else {
return array('Group' => array('id' => $data['User']
['group_id']));
}
}


4) Group model:

public $actsAs = array (
  'Acl' => array('type'=>'requester'),
  'Containable' => array(true,'notices' => true)
);

public function parentNode() {
if (!$this->id && empty($this->data)) {
return null;
}
$data = $this->data;
if (empty($this->data)) {
$data = $this->read();
}
if (!$data['Group']['id']) {
return null;
} else {
return array('Group' => array('id' => $data['Group']['id']));
}
}


5) ExpertsController:

public function beforeFilter() {
  parent::beforeFilter();
  $this->Auth->allowedActions = array('index');
}

public function index() {}


So when I request "http://www.mywebsite/experts";, I can't access to
index() view, there is a infinite loop??!
And if I request a protected action (e.g. "http://www.mywebsite/
experts/add", I'm never redirected to login page, there is a infinite
loop too??!

Do I something wrong in this basic usage of Auth + Acl?

Thank's by advance for any suggestions!

BR
--~--~-~--~~~---~--~~
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: "cake schema run create" doesn't keep my connection argument?!

2008-09-09 Thread avairet

Ok, nobody answer... but I have tested again with Eclipse's console
and it works !
I don't understand why there is an issue with Windows CLI...



On 8 sep, 14:56, avairet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When I launch "cake schema run create DbAcl -connection club" on a
> CLI, tables Aros, Acos, Acos_Aros are not created because my "-
> connection club" setting is not conserved...
>
> If I make a "var_dump($this->Schema)" on line 254 of "/cake/console/
> libs/schema.php", my "club" setting is OK in "connection" parameter of
> $this->Schema.
>
> But if I make a "var_dump($Schema)" on line 256 after "$Schema = 
> $this->Schema->load($options);", the "connection" parameter contain
>
> "default" and not "club" ?!!
>
> Is it a bug or do I something wrong?
>
> Thank's by advance for your suggestions.
--~--~-~--~~~---~--~~
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 schema run create" doesn't keep my connection argument?!

2008-09-08 Thread avairet

Hi,

When I launch "cake schema run create DbAcl -connection club" on a
CLI, tables Aros, Acos, Acos_Aros are not created because my "-
connection club" setting is not conserved...

If I make a "var_dump($this->Schema)" on line 254 of "/cake/console/
libs/schema.php", my "club" setting is OK in "connection" parameter of
$this->Schema.

But if I make a "var_dump($Schema)" on line 256 after "$Schema = $this-
>Schema->load($options);", the "connection" parameter contain
"default" and not "club" ?!!

Is it a bug or do I something wrong?

Thank's by advance for your suggestions.
--~--~-~--~~~---~--~~
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: ClassRegistry::isKeySet issue in Model.php revision 7527

2008-09-02 Thread avairet

Hi Mark,

Thank's for answer.
I've look for a "with" key in all my associations and found none...
I've seen line 657, so it's very strange?!!
Maybe another Core update...

BR


On 2 sep, 16:43, mark_story <[EMAIL PROTECTED]> wrote:
> On Sep 2, 4:42 am, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi everybody,
>
> > Since Trac moderators want always "Test Case" when submitting tickets,
> > I stop my bug effort and I report issues here. I hope some Unit Tests
> > gurus will report it in Trac correctly...
>
> > So, I've updated Cake Core from nightly builds SVN yesterday and
> > discover an update wich break my app. In fact it seems to be line 670
> > of cake/libs/model/model.php:
>
> > "if (!ClassRegistry::isKeySet($plugin . $joinClass) && !
> > App::import('Model', $plugin . $joinClass)) "
>
> > This line break some of my associations, database tables and class
> > models name wich are CamelCased or irregular plural forms.
>
> > For example, I have a model called "MyPractice" (table called
> > my_practices) wich is binded by HABTM with MyPracticeType (table
> > called my_practice_types).
> > The link table is calling "my_practices_has_my_practice_types". I know
> > this not Cake compliant, but I've correctly set the associations in
> > each models:
>
> > /* /app/model/my_practice.php */
> > public $hasAndBelongsToMany = array(
> >                         'MyPracticeType' => array('className' => 
> > 'MyPracticeType',
> >                                                 'joinTable' => 
> > 'my_practices_has_my_practice_types',
> >                                                 'foreignKey' => 
> > 'my_practice_id',
> >                                                 'associationForeignKey' => 
> > 'my_practice_type_id',
> >                                                 'unique' => true,
> >                                                 'conditions' => '',
> >                                                 'fields' => '',
> >                                                 'order' => '',
> >                                                 'limit' => '',
> >                                                 'offset' => '',
> >                                                 'finderQuery' => '',
> >                                                 'deleteQuery' => '',
> >                                                 'insertQuery' => ''
> >                         )
>
> > /* /app/model/my_practice_type.php */
>
> > public $hasAndBelongsToMany = array(
> >                         'MyPractice' => array('className' => 'MyPractice',
> >                                                 'joinTable' => 
> > 'my_practices_has_my_practice_types',
> >                                                 'foreignKey' => 
> > 'my_practice_type_id',
> >                                                 'associationForeignKey' => 
> > 'my_practice_id',
> >                                                 'unique' => true,
> >                                                 'conditions' => '',
> >                                                 'fields' => '',
> >                                                 'order' => '',
> >                                                 'limit' => '',
> >                                                 'offset' => '',
> >                                                 'finderQuery' => '',
> >                                                 'deleteQuery' => '',
> >                                                 'insertQuery' => ''
> >                         )
> >         );
>
> > When I launch any page of my app, this is the error message:
> > "Error:  Database table my_practices_has_my_practice_types for model
> > MyPracticesHasMyPracticeType was not found."
>
> > Why Cake is searching for a model that represents the HABTM?
>
> > If I delete the "!ClassRegistry::isKeySet($plugin . $joinClass) && "
> > clause on line 670, all works fine...
>
> > Any ideas to explain that issue are welcome!
>
> > BR
>
> > Avairet
>
> Do you have a 'with' key defined?  I don't see it in the model pastes
> above.  But you only go into the block you mentioned if the 'with' key
> is specified.  See line 657.
>
> -Mark
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



ClassRegistry::isKeySet issue in Model.php revision 7527

2008-09-02 Thread avairet

Hi everybody,

Since Trac moderators want always "Test Case" when submitting tickets,
I stop my bug effort and I report issues here. I hope some Unit Tests
gurus will report it in Trac correctly...

So, I've updated Cake Core from nightly builds SVN yesterday and
discover an update wich break my app. In fact it seems to be line 670
of cake/libs/model/model.php:

"if (!ClassRegistry::isKeySet($plugin . $joinClass) && !
App::import('Model', $plugin . $joinClass)) "

This line break some of my associations, database tables and class
models name wich are CamelCased or irregular plural forms.

For example, I have a model called "MyPractice" (table called
my_practices) wich is binded by HABTM with MyPracticeType (table
called my_practice_types).
The link table is calling "my_practices_has_my_practice_types". I know
this not Cake compliant, but I've correctly set the associations in
each models:

/* /app/model/my_practice.php */
public $hasAndBelongsToMany = array(
'MyPracticeType' => array('className' => 
'MyPracticeType',
'joinTable' => 
'my_practices_has_my_practice_types',
'foreignKey' => 
'my_practice_id',
'associationForeignKey' => 
'my_practice_type_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)

/* /app/model/my_practice_type.php */

public $hasAndBelongsToMany = array(
'MyPractice' => array('className' => 'MyPractice',
'joinTable' => 
'my_practices_has_my_practice_types',
'foreignKey' => 
'my_practice_type_id',
'associationForeignKey' => 
'my_practice_id',
'unique' => true,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
    'finderQuery' => '',
'deleteQuery' => '',
'insertQuery' => ''
)
);

When I launch any page of my app, this is the error message:
"Error:  Database table my_practices_has_my_practice_types for model
MyPracticesHasMyPracticeType was not found."

Why Cake is searching for a model that represents the HABTM?

If I delete the "!ClassRegistry::isKeySet($plugin . $joinClass) && "
clause on line 670, all works fine...

Any ideas to explain that issue are welcome!

BR

Avairet

--~--~-~--~~~---~--~~
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: App::import in a custom Component?

2008-06-12 Thread avairet

Just an update: my custom class is stored in "app/vendors/wshelper/
lib" of course!


On 12 juin, 17:47, avairet <[EMAIL PROTECTED]> wrote:
> I'm trying to use a custom class (which is stored in my "app/vendors"
> directory) in a custom Component, but I've always PHP warnings that
> say ''Fatal error: Class 'MyClass' not found"
>
> Here is my App::import call and my class definition
>
>  App::import('vendor', 'MyClass', false, 'wshelper'.DS.'lib');
>
> class MyComponentComponent extends Object {
>
>   function initialize() {
>
>   }
>
>   function startup(&$controller) {
>
>   }
>
> }
>
> ?>
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



App::import in a custom Component?

2008-06-12 Thread avairet

I'm trying to use a custom class (which is stored in my "app/vendors"
directory) in a custom Component, but I've always PHP warnings that
say ''Fatal error: Class 'MyClass' not found"

Here is my App::import call and my class definition


--~--~-~--~~~---~--~~
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: Pagination sorting by lexical order with HABTM?

2008-06-12 Thread avairet

Sorry, in the previous post "Item belongsTo Theme" !

On 12 juin, 15:25, avairet <[EMAIL PROTECTED]> wrote:
> Another same kind of problem:
>
> "Item hasOne Theme"
>
> Foreign key = theme_id
>
> In Theme controller, I've setted "$displayFields = 'name';"
>
> In my index view, the default paginate HTML table is good: Items are
> sorted by id and in the "Theme" column, names are displayed instead of
> ids.
>
> But when I click on "Theme" column to sort by theme, sort not reflect
> lexical order of themes but id order.
> I know it's normal because of the foreign key "theme_id" is the
> sorting key, but how can I make a lexical sort?
>
> On 12 juin, 13:15, avairet <[EMAIL PROTECTED]> wrote:
>
> > TABLES :
>
> > A) types: id, name, slug
>
> > B) famille_types: id, name, type_famille
>
> > C) famille_types_types (this is the join table) : type_id,
> > famille_type_id
>
> > MODEL ASSOCIATION :
>
> > "Type" HABTM "FamilleType"
>
> > In a index view, I would like paginate Type order by
> > "famille_types.name" not "famille_types.id" which is the default
> > behavior.
>
> > Here is the SQL request I would like to reproduce:
>
> > "SELECT types.id, types.slug, types.name, famille_types.name FROM
> > types INNER JOIN famille_types_types ON famille_types_types.type_id =
> > types.id INNER JOIN famille_types ON
> > famille_types_types.famille_type_id = famille_types.id ORDER BY
> > famille_types.name"
>
> > So how can I do that?
--~--~-~--~~~---~--~~
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: Pagination sorting by lexical order with HABTM?

2008-06-12 Thread avairet

Another same kind of problem:

"Item hasOne Theme"

Foreign key = theme_id

In Theme controller, I've setted "$displayFields = 'name';"

In my index view, the default paginate HTML table is good: Items are
sorted by id and in the "Theme" column, names are displayed instead of
ids.

But when I click on "Theme" column to sort by theme, sort not reflect
lexical order of themes but id order.
I know it's normal because of the foreign key "theme_id" is the
sorting key, but how can I make a lexical sort?



On 12 juin, 13:15, avairet <[EMAIL PROTECTED]> wrote:
> TABLES :
>
> A) types: id, name, slug
>
> B) famille_types: id, name, type_famille
>
> C) famille_types_types (this is the join table) : type_id,
> famille_type_id
>
> MODEL ASSOCIATION :
>
> "Type" HABTM "FamilleType"
>
> In a index view, I would like paginate Type order by
> "famille_types.name" not "famille_types.id" which is the default
> behavior.
>
> Here is the SQL request I would like to reproduce:
>
> "SELECT types.id, types.slug, types.name, famille_types.name FROM
> types INNER JOIN famille_types_types ON famille_types_types.type_id =
> types.id INNER JOIN famille_types ON
> famille_types_types.famille_type_id = famille_types.id ORDER BY
> famille_types.name"
>
> So how can I do that?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pagination sorting by lexical order with HABTM?

2008-06-12 Thread avairet

TABLES :

A) types: id, name, slug

B) famille_types: id, name, type_famille

C) famille_types_types (this is the join table) : type_id,
famille_type_id


MODEL ASSOCIATION :

"Type" HABTM "FamilleType"


In a index view, I would like paginate Type order by
"famille_types.name" not "famille_types.id" which is the default
behavior.

Here is the SQL request I would like to reproduce:

"SELECT types.id, types.slug, types.name, famille_types.name FROM
types INNER JOIN famille_types_types ON famille_types_types.type_id =
types.id INNER JOIN famille_types ON
famille_types_types.famille_type_id = famille_types.id ORDER BY
famille_types.name"

So how can I do that?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



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

2008-06-10 Thread avairet

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



Re: $this->getID() in a save loop ??

2008-05-21 Thread avairet

I answer myself after a trip on Irc channel (thnk's to Gwoo and
Daanz):

1) $this->getID() and $this->getLastInsertID() are deprecated for a
long time, but it is not indicated in the source code
2) we must use $this->id() instead
3) in a loop, we must call $this->create() before $this->save()

Hope this helps and understandable!



On 21 mai, 16:31, avairet <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm surprised by $this->getID() behavior when I call $this->save() in
> a loop...
> Actually, $this->getID() returns always the same number!?
>
> My code:
>
> for ($i=1;$i<=$max;$i++) {
> $new_tag = array('name'=>$data['Item']['Tag'.$i], 'slug'=>$slug,
> 'insertion'=>1);
> $this->save($new_tag,false);
> $new_id = $this->getID();
> echo "new_id : ".$new_id."";
>
> }
>
> For each loop step, "new_id" is always the first new id...
> Of course, all my save's calls are Mysql "INSERT", not UPDATE...
>
> Any idea?
>
> I'm using Cake 1.2 nightly builds.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



$this->getID() in a save loop ??

2008-05-21 Thread avairet

Hi all,

I'm surprised by $this->getID() behavior when I call $this->save() in
a loop...
Actually, $this->getID() returns always the same number!?

My code:

for ($i=1;$i<=$max;$i++) {
$new_tag = array('name'=>$data['Item']['Tag'.$i], 'slug'=>$slug,
'insertion'=>1);
$this->save($new_tag,false);
$new_id = $this->getID();
echo "new_id : ".$new_id."";
}

For each loop step, "new_id" is always the first new id...
Of course, all my save's calls are Mysql "INSERT", not UPDATE...

Any idea?

I'm using Cake 1.2 nightly builds.

--~--~-~--~~~---~--~~
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: $this->redirect from a Model?

2008-04-30 Thread avairet

No, why???

In fact I do the move_upload in beforeSave like that:

if (@move_uploaded_file($this->data['myModel']['tmp_name'],'mypath')
=== false) {
  $this->invalidate('myfile',__('Error message',true));
  return false;
}

And I've neither sql delete, neither file rename!

Thank's a lot for your help.

BR

On 30 avr, 18:43, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Are you renaming the uploaded file based off your Model ID?
>
> On Apr 30, 12:09 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > @clark :
>
> > >>> I'm assuming you do the move uploaded file in the afterSave() to use 
> > >>> the Model ID in the filename?
>
> > YES, exactly, because if the move_upload fails I would like to delete
> > my record!
>
> > >>> move the uploaded file beforeSave() so you can invalidate() if 
> > >>> necessary, and then do a file rename in the afterSave()
>
> > Ok, why not... but I think it's easier to make a sql delete instead of
> > a file rename or file unlink
>
> > On 30 avr, 18:02, avairet <[EMAIL PROTECTED]> wrote:
>
> > > Ok, ok, ok guys, don't stress with my stupid questions ;o))
>
> > > So, how can I return a value to my controller after my save logic?
> > > Must I do my move_uploaded_file in the Controller?
>
> > > On 30 avr, 17:59, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > > > On Wed, Apr 30, 2008 at 11:53 AM, avairet <[EMAIL PROTECTED]> wrote:
>
> > > > >  In fact, in my Model::afterSave, I do a "move_uploaded_file()" and if
> > > > >  this move doesn't work, I would like to redirect in the previous
> > > > >  controller action instead of the redirect(index)
>
> > > > You cannot redirect from inside a model, like Clark said.  You must
> > > > get your model to return some value to the controller that you can use
> > > > to determine if you need to redirect or not.
>
> > > > Again, this comes with understanding both Cake's conventions and
> > > > understanding how Cake's MVC implementation works.
>
> > > > --
> > > > 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: $this->redirect from a Model?

2008-04-30 Thread avairet

@clark :

>>> I'm assuming you do the move uploaded file in the afterSave() to use the 
>>> Model ID in the filename?
YES, exactly, because if the move_upload fails I would like to delete
my record!

>>> move the uploaded file beforeSave() so you can invalidate() if necessary, 
>>> and then do a file rename in the afterSave()
Ok, why not... but I think it's easier to make a sql delete instead of
a file rename or file unlink





On 30 avr, 18:02, avairet <[EMAIL PROTECTED]> wrote:
> Ok, ok, ok guys, don't stress with my stupid questions ;o))
>
> So, how can I return a value to my controller after my save logic?
> Must I do my move_uploaded_file in the Controller?
>
> On 30 avr, 17:59, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Wed, Apr 30, 2008 at 11:53 AM, avairet <[EMAIL PROTECTED]> wrote:
>
> > >  In fact, in my Model::afterSave, I do a "move_uploaded_file()" and if
> > >  this move doesn't work, I would like to redirect in the previous
> > >  controller action instead of the redirect(index)
>
> > You cannot redirect from inside a model, like Clark said.  You must
> > get your model to return some value to the controller that you can use
> > to determine if you need to redirect or not.
>
> > Again, this comes with understanding both Cake's conventions and
> > understanding how Cake's MVC implementation works.
>
> > --
> > 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: $this->redirect from a Model?

2008-04-30 Thread avairet

Ok, ok, ok guys, don't stress with my stupid questions ;o))

So, how can I return a value to my controller after my save logic?
Must I do my move_uploaded_file in the Controller?




On 30 avr, 17:59, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 30, 2008 at 11:53 AM, avairet <[EMAIL PROTECTED]> wrote:
>
> >  In fact, in my Model::afterSave, I do a "move_uploaded_file()" and if
> >  this move doesn't work, I would like to redirect in the previous
> >  controller action instead of the redirect(index)
>
> You cannot redirect from inside a model, like Clark said.  You must
> get your model to return some value to the controller that you can use
> to determine if you need to redirect or not.
>
> Again, this comes with understanding both Cake's conventions and
> understanding how Cake's MVC implementation works.
>
> --
> 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: $this->redirect from a Model?

2008-04-30 Thread avairet

Hi Clark,

Thank you for answer.

I don't redirect after find, it's an error in my first post. I would
like to redirect after save!

I know it's a bad idea to redirect from Model, but I'm looking for a
solution to stop action after a record save, like the return false in
before Save.

In fact, in my Model::afterSave, I do a "move_uploaded_file()" and if
this move doesn't work, I would like to redirect in the previous
controller action instead of the redirect(index)

Sorry for my simple English, I hope this message is understandable...



On 30 avr, 17:46, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> You shouldn't redirect from a model as a model should only be dealing
> with data, not page logic.
>
> You should be doing the redirect in your controller.
>
> What are you redirecting for anyway? If you redirect after finding
> data, you'll lose that data and have to find again.
>
> On Apr 30, 11:36 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > Is it possible to redirect from the Model?
> > I would like to redirect in an specific action from "afterFind()"
> > callback... but if I set "return false" in this callback, like it's
> > possible in "beforeSave()", I can't redirect!
>
> > Thanks by advance for your ideas.
>
> > BR
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



$this->redirect from a Model?

2008-04-30 Thread avairet

Hi everybody,

Is it possible to redirect from the Model?
I would like to redirect in an specific action from "afterFind()"
callback... but if I set "return false" in this callback, like it's
possible in "beforeSave()", I can't redirect!

Thanks by advance for your ideas.

BR
--~--~-~--~~~---~--~~
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: Call file stored in webroot from an iframe?

2008-04-30 Thread avairet

Thank you guys!

In fact, the error was occured because the ".html" file did not exist!
So if the file exists, iframe with a source file stored in Webroot
works fine.
Otherwise, Cake is searching for a "FilesController"...



On 29 avr, 23:42, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> It sounds to me like you are running cakephp in your host's main
> directory, in which case you will have to edit your .htaccess to make
> an exception for the directories you want to access. Otherwise, cake
> will always look for the file as a controller. Aditionally, you may
> want to look into sticking it in /views/pages and using the pages
> controller to access it. Or, you could use a php include to include it
> from wherever it is on the file system inside a scrollable div.
>
> On Apr 29, 11:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > If the URL is valid, htaccess should return the page, and not hand off
> > the URL to Cake for processing; what you want to do should totally be
> > possible;
>
> > How do you access the site?http://localhost/projectorhttp://project.loc
> > or something?
>
> > On Apr 29, 12:25 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > > Hi everybody,
>
> > > Is it possible to call a file stored in webroot from an iframe?
>
> > > My iframe tag:
> > > 
>
> > > My webroot structure (partial):
>
> > > webroot
> > >  |- css
> > >  |- files
> > > |- 360
> > >  |- myfile.html
> > >  |- img
> > >  |- js
>
> > > In my view render, Cake is looking for a "FilesController" and an
> > > "360" action??!
> > > I've tried to use an absolute url and the problem is always here...
>
> > > Thank's by advance if you have an idea to resolve this issue.
>
> > > BR
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Call file stored in webroot from an iframe?

2008-04-29 Thread avairet

Hi everybody,

Is it possible to call a file stored in webroot from an iframe?

My iframe tag:


My webroot structure (partial):

webroot
 |- css
 |- files
|- 360
 |- myfile.html
 |- img
 |- js

In my view render, Cake is looking for a "FilesController" and an
"360" action??!
I've tried to use an absolute url and the problem is always here...

Thank's by advance if you have an idea to resolve this issue.

BR

--~--~-~--~~~---~--~~
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: saveAll and HABTM?

2008-04-29 Thread avairet

Hi Aaron,

I re-read my old messages...
My data array seems to look like your example...
But neither Model1->saveAll() or Model2->saveAll() seems to work!

In my case and standing for Model::saveAll() enhancement or new
function, I make a Model1->save($this->data)
which save my main model and its HABTM and in my
Controller::afterSave() method, I do: unset(this->data[MyModel1]),
unset(this->data[MyHABTM1])...
Then I call a custom action named "saveOthers()" with the $this->data
array updated!

That work very fine and avoid a lot of queries due to save() +
saveAll().
But it seems the error validation messages are not displayed when
saveOthers() fail...



On 8 avr, 22:41, aaron bauman <[EMAIL PROTECTED]> wrote:
> I have noticed this behavior as well.
> It's because in Model::saveAll, the call to Model::save uses 
> this->data[$this->alias] instead of $this->data.
>
> therefore if you have a data array that looks like
> array(
>   'Model1' => array(data)
>   'Model2' => array(data)
> )
>
> and you call Model1->saveAll, guess what? Model2 doesn't get saved if
> it's a habtm relation.
>
> there is a ticket already opened in the bug 
> trackerhttps://trac.cakephp.org/ticket/4389
>
> i'll be watching that ticket for updates and until then banging my
> head against the wall.
>
> On Apr 3, 10:16 am,avairet<[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I'm using nightly builds from 1.2.x.x branch.
>
> > My main model Item have this associations:
> > Item hasOne Article
> > Item hasOne Photo
> > Item hasAndBelongsToMany Tag
> > ...
>
> > In a form I have these fields :
> > data['Item']['id'] (it's results on a form input TEXT)
> > data['Item']['title'] (it's results on a form input TEXT)
> > data['Article']['legend'] (it's results on a form input TEXT)
> > data['Photo']['credits'] (it's results on a form input TEXT)
> > data['Tag']['Tag'] (it's results on a form SELECT multiple)
>
> > Apparently, the Model::saveAll() method does not save the HABTM, even
> > this method call itself the save() method...
>
> > At this point I make a $this->Item->save($this->data) and after a
> > $this->Item->saveAll($this->data).
> > That's works fine but problems occur when I want validate and display
> > error...
>
> > So how can I save all fields in one call and manage correctly
> > validations and error messages?
--~--~-~--~~~---~--~~
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: Init ACL with CLI?

2008-04-29 Thread avairet

Hi Aran and thank you

1) OK, so it's obligatory to create a root node?
Because in a tutorial, a guy has created a temporary controller to
insert ARO/ACO/ACO_ARO and he has not created this root level...
What kind of permissions and roles for this "root"?

2) Yes I'm using AclBehavior in models and AclComponent in
controllers.
But I don't understand why you said that AclBeavhior doesn't create
alias?! It does!
It doesn't create "model" and "foreign_key" and for you it's normal.
OK, so what is the interest of "model" and "foreign_key" field in the
ARO table?

3) Ok, you're right to this point, it's better useful to invert the
tree!

Sorry for my simple English:

BR

On 25 avr, 17:50, aranworld <[EMAIL PROTECTED]> wrote:
> 1) The syntax in the end is correct.  You could also do:
> cake acl create aro root superadmin
>
> 2) When you create a node in the CLI, the model and foreign_key fields
> are blank.  If you want these fields added automatically, then you
> need to add the nodes from within your application using the models
> you created.  I presume you are using the AclBehavior?  Anyways, be
> aware that the AclBehavior does NOT create the alias for you, so you
> will have to create some coding to handle the alias creation
> automatically.
>
> 3) I personally feel that it is easier to put the most generic user at
> the top of my ARO tree and put the superuser at the bottom.  Let's say
> you have a user and an editor.
>
> If the editor is the parent of the user, you would have to do this:
>
> cake acl grant editor articles update
> cake acl grant editor articles read
> cake acl grant editor articles create
> cake acl deny user articles update
> cake acl deny user articles create
>
> If the user is the parent of the editor, then this is all you need:
>
> cake acl grant user read
> cake acl grant editor create
> cake acl grant editor update
>
> -Aran
>
> On Apr 25, 7:19 am,avairet<[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I'm trying to use the ACL, but I don't understand some stuff.
>
> > I have created the 3 tables (aros, acos, aros_acos) with the CLI.
> > Fine.
> > I have a Groups table (called 'admin_groupes' in my case).
> > I have a Users table (called 'administrateurs' in my case), with a FK
> > called "admin_groupe_id"
>
> > I want create 3 aros : SuperAdmin, Admin, Redacteur that correspond to
> > my AdminGroupes
>
> > So, I want create my first aro with the CLI and the mystery start!
> > How must I launch my command in CLI?
>
> > Because I've tested this :
>
> > cake acl create aro AdminGroupe 1 null "Super Admin"
>
> > and I've this error message : Could not find parent node using
> > reference "AdminGroupe"
>
> > If I launch this other command:
>
> > cake acl create aro / null "Super Admin"
>
> > I obtain this message : New Aro 'null' created.
>
> > And finally, if I launch : cake acl create aro / "Super Admin", that
> > works fine, but the "model" and "foreign_key" fields from my aros
> > table are empty... Why? Is it normal?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Init ACL with CLI?

2008-04-25 Thread avairet

Hi everybody,

I'm trying to use the ACL, but I don't understand some stuff.

I have created the 3 tables (aros, acos, aros_acos) with the CLI.
Fine.
I have a Groups table (called 'admin_groupes' in my case).
I have a Users table (called 'administrateurs' in my case), with a FK
called "admin_groupe_id"

I want create 3 aros : SuperAdmin, Admin, Redacteur that correspond to
my AdminGroupes

So, I want create my first aro with the CLI and the mystery start!
How must I launch my command in CLI?

Because I've tested this :

cake acl create aro AdminGroupe 1 null "Super Admin"

and I've this error message : Could not find parent node using
reference "AdminGroupe"

If I launch this other command:

cake acl create aro / null "Super Admin"

I obtain this message : New Aro 'null' created.

And finally, if I launch : cake acl create aro / "Super Admin", that
works fine, but the "model" and "foreign_key" fields from my aros
table are empty... Why? Is it normal?


--~--~-~--~~~---~--~~
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: Format date field in 3 select

2008-04-24 Thread avairet

Hi James,

Maybe my English is poor...
I know the FormHelper::datetime do that.
But in my case I need to specify a special DOM Id for each select to
add a "datepicker" and the FormHelper::datetime doesn't allow this
possibility.
So my question was about a Cake's method to deconstruct my date field
(-MM-DD) to pass the DD to my first select, MM to my second and
 to my third. And in fact there is no other solution to make a
substr() !




On Apr 24, 2:07 am, James K <[EMAIL PROTECTED]> wrote:
> FormHelper's datetime input type already done exactly this. You don't
> have to manually put together the day/month/year fields.
>
> On Apr 23, 12:43 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I'm searching for a day how format a date field from Mysql (-MM--
> > DD) to 3 form's selects:
>
> > - date from mysql : 2008-04-23
> > - my form fields are build like this:
> > for ($i=0;$i<11;$i++) {
> > $form->day('DixDate.'.$i.'.date',null,array('id'=>'date-sel'.$i.'-
> > dd')).'-'.
> > $form->month('DixDate.'.$i.'.date',null,array('id'=>'date-sel'.$i.'-
> > mm')).'-'.
> > $form->year('DixDate.'.$i.'.date','1900',$current_year,null)
>
> > }
>
> > I'm using "day", "month", "year" instead of "input()" because I'm
> > using a date picker that is need a special DOM id to work.
>
> > How can I pass the day value, the month value and year value for each
> > field?
> > Must I do a "substr()" on each of my date?
>
> > I hope my message is understandable...
>
> > Thanks for help.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Format date field in 3 select

2008-04-23 Thread avairet

Hi everybody,

I'm searching for a day how format a date field from Mysql (-MM--
DD) to 3 form's selects:

- date from mysql : 2008-04-23
- my form fields are build like this:
for ($i=0;$i<11;$i++) {
$form->day('DixDate.'.$i.'.date',null,array('id'=>'date-sel'.$i.'-
dd')).'-'.
$form->month('DixDate.'.$i.'.date',null,array('id'=>'date-sel'.$i.'-
mm')).'-'.
$form->year('DixDate.'.$i.'.date','1900',$current_year,null)
}

I'm using "day", "month", "year" instead of "input()" because I'm
using a date picker that is need a special DOM id to work.

How can I pass the day value, the month value and year value for each
field?
Must I do a "substr()" on each of my date?

I hope my message is understandable...

Thanks for help.



--~--~-~--~~~---~--~~
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: Model: how to avoid call of afterFind() in some cases?

2008-04-17 Thread avairet

Hello,

Some solutions...

- test a special field (or value) into $results in afterFind(), a
field (or value) that is only fetch by your special action's find()
- create a custom find() method in your model and call it from your
controller's special action (for example: $this->MyModel-
>customFind(); )
- use Model::query() instead of find() to avoid all model's automagic
callbacks
- set a special Model's variable in your Controller like you say

- maybe a Behavior with an empty afterFind() method and a call to the
Behavior::find() instead of the Model::find() ? I'm not a master of
Behavior usage...

Hope this answer is understandable and helps you...

BR


On 17 avr, 09:19, orbdex <[EMAIL PROTECTED]> wrote:
> again: forgot the version: cake 1.2 latest beta
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-04-09 Thread avairet

I'm wearing glasses too!

Your solution seems interesting but how be sure the replace method
match all possile accented chars typoing by the user?
And how invalidate blanks, spaces, symbols, number?
I'm not sure to understand very well your suggest...

In any case, great thanks to interest of my problem!

Aurélien

On 9 avr, 17:25, grigri <[EMAIL PROTECTED]> wrote:
> > Grigri, my first example is exactly what you said and it doesn't
> > work...
>
> Heh you're right, sorry - I was looking at the one that "almost"
> works...
>
> > Do you need some glasses ;o))
>
> Already wearing them!
>
> I've had a think, though - instead of doing a simple regexp, try using
> a custom validation method that does the following:
>
> * replaces accented chars with non-accented chars [adapt code from
> Mariano's Sluggable behavior - handles UTF-8 and latin1 (I think) ]
> * validates the result against normal alphaNumeric regexp
>
> Of course you don't want to *change* the data in the model, just
> change the string that is matched.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-04-09 Thread avairet

Grigri, my first example is exactly what you said and it doesn't
work...

Do you need some glasses ;o))

Aurélien

On 9 avr, 16:32, grigri <[EMAIL PROTECTED]> wrote:
> Your regexp: '/^[[:alpha:]]/'
>
> should probably be '/^[[:alpha:]]+$/'
>
> On Apr 9, 3:05 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi Max and Grigri,
>
> > I've retested some solutions to validate with a custom regex, but no
> > success!
> > It seems the problem is due to "utf-8", because in a "iso-8859-1"
> > context, it seems to work...
>
> > My environment:
>
> > Cake 1.2.x.x nightly builds
> > PHP 5.2.5
> > MySQL 5.0.45
> > Apache 2
>
> > I've setted my LOCALE in bootstrap.php like that:
>
> > $locale = 'fr_FR.UTF-8';
> > if (env('REMOTE_ADDR') === '127.0.0.1' ||
> > (isset($_SERVER['HTTP_USER_AGENT']) && strpos('Win',
> > $_SERVER['HTTP_USER_AGENT']) !== false))
> > {
> >   $locale = 'fra';}
>
> > setlocale(LC_ALL, $locale);
>
> > And in my Model, I put this validation criteria:
>
> > public $validate = array(
> > 'prenom' => array(
> >  'alphabet' 
> > => array(
> > 
> > 'rule' => array('custom', '/^[[:alpha:]]+$/'),
> > 
> > 'message' => 'Caractères interdits'
> > )
> > )
> > )
>
> > And another test with:
>
> > public $validate = array(
> > 'prenom' => array(
> >  'alphabet' 
> > => array(
> > 
> > 'rule' => array('custom', '/^\w+$/'),
> > 
> > 'message' => 'Caractères interdits'
> > )
> > )
> > )
>
> > And another again:
>
> > public $validate = array(
> > 'prenom' => array(
> >  'alphabet' 
> > => array(
> > 
> > 'rule' => array('custom', '/^[a-z]+$/i'),
> > 
> > 'message' => 'Caractères interdits'
> > )
> > )
> > )
>
> > For all this pattern, if I put accented chars in my form, the
> > validation allways fails!
> > I've tested under Windows and Linux, with and without the LOCALE
> > There is only one case which works partially:
>
> > public $validate = array(
> > 'prenom' => array(
> >  'alphabet' 
> > => array(
> > 
> > 'rule' => array('custom', '/^[[:alpha:]]/'),
> > 
> > 'message' => 'Caractères interdits'
> > )
> > )
>
> > In this case, if I put an accented chars at the first place, the
> > validation is OK ?! But if I put a symbol at the second place, the
> > validation is OK too ?!
>
> > Maybe my regex patterns are not well-formated?
> > Maybe my combination with "setlocale" is not good?
>
> > Actually, it's a really problem for non-english lexical...
>

Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-04-09 Thread avairet

Hi Max and Grigri,

I've retested some solutions to validate with a custom regex, but no
success!
It seems the problem is due to "utf-8", because in a "iso-8859-1"
context, it seems to work...

My environment:

Cake 1.2.x.x nightly builds
PHP 5.2.5
MySQL 5.0.45
Apache 2

I've setted my LOCALE in bootstrap.php like that:

$locale = 'fr_FR.UTF-8';
if (env('REMOTE_ADDR') === '127.0.0.1' ||
(isset($_SERVER['HTTP_USER_AGENT']) && strpos('Win',
$_SERVER['HTTP_USER_AGENT']) !== false))
{
  $locale = 'fra';
}
setlocale(LC_ALL, $locale);

And in my Model, I put this validation criteria:

public $validate = array(
'prenom' => array(
 'alphabet' => 
array(

'rule' => array('custom', '/^[[:alpha:]]+$/'),

'message' => 'Caractères interdits'
)
)
)

And another test with:

public $validate = array(
'prenom' => array(
 'alphabet' => 
array(

'rule' => array('custom', '/^\w+$/'),

'message' => 'Caractères interdits'
)
)
)

And another again:

public $validate = array(
'prenom' => array(
 'alphabet' => 
array(

'rule' => array('custom', '/^[a-z]+$/i'),

'message' => 'Caractères interdits'
)
)
)

For all this pattern, if I put accented chars in my form, the
validation allways fails!
I've tested under Windows and Linux, with and without the LOCALE
There is only one case which works partially:

public $validate = array(
'prenom' => array(
 'alphabet' => 
array(

'rule' => array('custom', '/^[[:alpha:]]/'),

'message' => 'Caractères interdits'
)
)

In this case, if I put an accented chars at the first place, the
validation is OK ?! But if I put a symbol at the second place, the
validation is OK too ?!

Maybe my regex patterns are not well-formated?
Maybe my combination with "setlocale" is not good?

Actually, it's a really problem for non-english lexical...



On 9 avr, 07:53, Max Romantschuk <[EMAIL PROTECTED]> wrote:
> On Apr 8, 3:04 pm, grigri <[EMAIL PROTECTED]> wrote:
>
> > For a locale-based solution, has anyone tried just using the \w
> > metachar, as in : `/^\w+$/` ?
>
> > Does this work?
>
> From what I could tell in PCRE's docs, how PCRE behaves is dependent
> on how it is compiled. At least the i-modifier is, according to the
> docs, do I'd assume the \w character class is as well. I wanted a
> solution that would be as immune as possible to installation dependent
> things like this. \w is the correct solution in theory, but I can't
> have my apps breaking because PRCE behaves a little bit differently in
> Linux distro X... :)
>
> .max
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-04-08 Thread avairet

Hi grigri,

I've just tried your solution : as in : `/^\w+$/`
It doesn't work... if I type some French accented characters or "-" in
an input called "prenom".

Here is my $validate rule :
public $validate = array(
'prenom' => array(
'minLength' => 
array(

'rule' => array('minLength','2'),

'message'=>'My error message 1'
),
'custom' => 
array(

'rule' => '/^\w+$/',

'message' => 'My error message 2'
)
)


On 8 avr, 14:04, grigri <[EMAIL PROTECTED]> wrote:
> For a locale-based solution, has anyone tried just using the \w
> metachar, as in : `/^\w+$/` ?
>
> According to the php docs:
>
> > A "word" character is any letter or digit or the underscore character,
> > that is, any character which can be part of a Perl "word".
> > The definition of letters and digits is controlled by PCRE's character 
> > tables,
> > and may vary if locale-specific matching is taking place.
> > For example, in the "fr" (French) locale, some character codes
> > greater than 128 are used for accented letters, and these are matched by \w.
>
> Does this work?
>
> On Apr 8, 6:54 am, Max Romantschuk <[EMAIL PROTECTED]> wrote:
>
> > Having run into this issue myself, I created a Latin-9 compatible
> > validation function for alphanumeric data. Our system is not using
> > Unicode, so you need to be using Latin-9 (ISO-8859-15) for your
> > CakePHP installation and database. I assume the approach could be
> > adapted to UTF-8 quite easily.
>
> > I chose to use a function to generate the characters I need for the
> > regexp, as keeping the actual code ASCII makes it immune to encoding
> > issues. I decided to keep my "magic string" as a global constant, but
> > encapsulating it into the validation function would work as well.
>
> > === Put in bootstrap.php -- STARTS ===
>
> > // Special non-ascii characters for encoding-proof usage.
> > global $LATIN_9_EXTCHARS;
> > $LATIN_9_EXTCHARS = array(
> >   166, // S with caron (hachek)
> >   168, // s with caron (hachek)
> >   180, // Z with caron (hachek)
> >   184, // z with caron (hachek)
> >   188, // Capital ligature OE
> >   189, // Small ligature oe
> >   190, // Y with diaeresis
> >   192, // A Grave
> >   193, // A Acute
> >   194, // A Circumflex
> >   195, // A Tilde
> >   196, // A Diaeresis
> >   197, // A Ring
> >   198, // AE Digraph
> >   199, // C Cedilla
> >   200, // E Grave
> >   201, // E Acute
> >   202, // E Circumflex
> >   203, // E Diaeresis
> >   204, // I Grave
> >   205, // I Acute
> >   206, // I Circumflex
> >   207, // I Diaeresis
> >   208, // Uppercase Eth
> >   209, // N Tilde
> >   210, // O Grave
> >   211, // O Acute
> >   212, // O Circumflex
> >   213, // O Tilde
> >   214, // O Diaeresis
> >   216, // O Slash
> >   217, // U Grave
> >   218, // U Acute
> >   219, // U Circumflex
> >   220, // U Diaeresis
> >   221, // Y Acute
> >   222, // Uppercase Thorn
> >   223, // German Double s
> >   224, // a Grave
> >   225, // a Acute
> >   226, // a Circumflex
> >   227, // a Tilde
> >   228, // a Diaeresis
> >   229, // a Ring
> >   230, // ae Digraph
> >   231, // c Cedilla
> >   232, // e Grave
> >   233, // e Acute
> >   234, // e Circumflex
> >   235, // e Diaeresis
> >   236, // i Grave
> >   237, // i Acute
> >   238, // i Circumflex
> >   239, // i Diaeresis
> >   240, // Lowercase Eth
> >   241, // n Tilde
> >   242, // o Grave
> >   243, // o Acute
> >   244, // o Circumflex
> >   245, // o Tilde
> >   246, // o Diaeresis
> >   248, // o Slash
> >   249, // u Grave
> >   250, // u Acute
> >   251, // u Circumflex
> >   252, // u Diaeresis
> >   253, // y Acute
> >   254, // Lowercase Thorn
> >   255, // y Diaeresis
> > );
>
> > // Function to turn array above into a string.
> > function _charcodes_to_string($codes) {
> >   $output = '';
> >   foreach($codes as $code) {
> > $output .= chr($code);
> >   }
> >   return $output;
>
> > }
>
> > // Special chars character string for validation regexps.
> > global $LATIN_9_EXTCHARS_STRING;
> > $LATIN_9_EXTCHARS_STRING = _charcodes_to_string($LATIN_9_EXTCHARS);
>
> > === Put in bootstrap.php -- ENDS ===
>
> > Then the actual validation function:
>
> > === Put in app_model.php -- STARTS ===
>
> >   /**
> >* Validator function for alphanumeric values with chars
> >* from the Latin-9 charset.
> >*
> >* @p

saveAll and HABTM?

2008-04-03 Thread avairet

Hi,

I'm using nightly builds from 1.2.x.x branch.

My main model Item have this associations:
Item hasOne Article
Item hasOne Photo
Item hasAndBelongsToMany Tag
...

In a form I have these fields :
data['Item']['id'] (it's results on a form input TEXT)
data['Item']['title'] (it's results on a form input TEXT)
data['Article']['legend'] (it's results on a form input TEXT)
data['Photo']['credits'] (it's results on a form input TEXT)
data['Tag']['Tag'] (it's results on a form SELECT multiple)


Apparently, the Model::saveAll() method does not save the HABTM, even
this method call itself the save() method...

At this point I make a $this->Item->save($this->data) and after a
$this->Item->saveAll($this->data).
That's works fine but problems occur when I want validate and display
error...

So how can I save all fields in one call and manage correctly
validations and error messages?




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



Re: CSS and images?

2008-03-04 Thread avairet

Hi Jason,

Basically, CSS and images should be in "webroot/ccs" and "webroot/img"
directories, not in the App.

Hope this helps you...

BR

Avairet


On 4 mar, 14:59, Jason <[EMAIL PROTECTED]> wrote:
> More noob questions.
>
> Where do I put my CSS in relation to the app folder?
>
> Where do I put my images in relation to the app folder?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Better way to create reflexive association?

2008-03-03 Thread avairet

Hello grigri,

I've tested your solution : when I just save an Article with it's
complements, that's work fine.
But if I save other Articles linked models, there is a problem: in the
join table "articles_articles" the other models ids are added!

Example:

Articles HABTM Articles (article_id1, article_id2)
Articles HABTM Tags (article_id, tag_id)
Articles HABTM Feeds (article_id, feed_id)

In a form, when I create an Article, I can select zero or more
Articles to complete my new article, zero or more Tags and zero or
more Feeds.
If I select one or more Articles and zero Tags and zero Feeds, that's
work fine: the new id and all articles ids are saved correctly in my
join table "articles_articles".
But if I select one or more Articles AND (one or more Tags OR one or
more Feeds), Tags ids or Feeds ids are saved in the join table too...

Must I use "unbind" before saving to avoid this issue?

Hope this post is clear...

BR

Avairet

On 29 fév, 13:59, avairet <[EMAIL PROTECTED]> wrote:
> OK, great!
>
> Thank you so much. I try this stuff now.
>
> On 29 fév, 13:52, grigri <[EMAIL PROTECTED]> wrote:
>
> > Nonono, the 'ReadTheseFirst' and 'ReadTheseAfter' are aliases for the
> > same model - Article. You don't need to create any more model files.
>
> > For the form side of things, it will be as per normal :
>
> >  > echo $form->input('ReadTheseFirst.ReadTheseFirst', array('multiple' =>
> > 'checkbox')); // Or however you normally do things
> > ?>
>
> > On Feb 29, 12:24 pm,avairet<[EMAIL PROTECTED]> wrote:
>
> > > Ok, an only one question: must I create the "ReadTheseFirst" and
> > > "ReadTheseAfter" model files?
> > > In other words, in a form how indicate the data[] array?
>
> > > On 29 fév, 12:48, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > You can give them any aliases you like, but they must be distinct
> > > > (different from each other AND from the 'Article' model name).
>
> > > > You can also rename the field names, just make sure you change the
> > > > keys in the association too - in the right order!
>
> > > > On Feb 29, 11:14 am,avairet<[EMAIL PROTECTED]> wrote:
>
> > > > > OK thank you grigri!
>
> > > > > I will try your solution, but is it your naming obligatory for aliases
> > > > > (ReadThese...) and field's names?
>
> > > > > On 29 fév, 12:07, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > > > Try this:
>
> > > > > > join table "articles_articles" : article1_id and article2_id
>
> > > > > > class Article extends AppModel {
> > > > > >   var $hasAndBelongsToMany = array(
> > > > > > 'ReadTheseFirst' => array('className' => 'article', 'joinTable' 
> > > > > > =>
> > > > > > 'articles_articles', 'foreignKey' => 'article1_id',
> > > > > > 'associationForeignKey' => 'article2_id'),
> > > > > > 'ReadTheseAfter' => array('className' => 'article', 'joinTable' 
> > > > > > =>
> > > > > > 'articles_articles', 'foreignKey' => 'article2_id',
> > > > > > 'associationForeignKey' => 'article1_id')
> > > > > >   );
>
> > > > > > }
>
> > > > > > On Feb 29, 10:56 am,avairet<[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi Adam and thank you for answer,
>
> > > > > > > My schema :
>
> > > > > > > Table "articles" with "id" and "title" fields.
> > > > > > > My reflexive association:
> > > > > > > - an article complete n:m articles
> > > > > > > - an article is completed by n:m articles
>
> > > > > > > Is that clear?
>
> > > > > > > On 29 fév, 11:46, Adam Royle <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > I am sure this is possible, you just need to use aliases and set
> > > > > > > > custom join keys. What data are you modelling? It might be 
> > > > > > > > easier to
> > > > > > > > give an example if you tell us your schema.
>
> > > > > > > &

Re: Model primarykey

2008-02-25 Thread avairet

> That's exactly what I've been saying from the beginning.  The
> difference is, one is an application key which has meaning within the
> context of the application itself, and one is a business key which
> satisfies some business requirement.

OK Nate, but a mapping layer must reconciliate logic and business not
to impose one to the other...
And my sentence was about the old discussion cited by Baz in the
firsts posts where a guy said this is the same thing!

> Well, if you think this is an easy thing to do, then go for it.

Sorry, I've never said that's an easy thing to do!
But if you don't implement a thing, just because it's complex and you
don't use it, it's really damage...
It's harm the framework and it's team recognition...

> You can argue about relational theory all you want, it's
> simply irrelevant to the decision-making process here.  When it comes
> down to it, supporting multi-column primary keys is just not that
>useful to *me*. Furthermore, not enough people have raised it as an
> issue in order for me to go out of my way for them.

> I hope you now understand from my comments above that whether or not
> it's an issue for you personally is completely irrelevant.
> It's not an issue for me personally, and it's not an issue for most
people.

Yes Nate, I understand now that's your choice! But there are a lot of
posts in this Google groups and some tickets in trac about this
problematic.

In brief:
- I'm using CakePHP even if I must rewrite a lot of my tables and
relations in my database schemas, because like you say it has many
other useful functionnalities!
- I'm not enough "master" with it to develop myself this feature, but
in some months, why not?
- I've just said that will be a good idea to implement it in the
future releases, to improve the quality of framework.
- I understand it's hard for you to always repeat the same thing, but
keep cool with new members of community, because this problematic is
not written on documentation/manual/API

BR

Avairet
a simple stupid French guy ;o)



On 25 fév, 14:21, nate <[EMAIL PROTECTED]> wrote:
> On Feb 13, 8:25 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Only one thing: a Primary Key is not equal to Unique not null index!
>
> That's exactly what I've been saying from the beginning.  The
> difference is, one is an application key which has meaning within the
> context of the application itself, and one is a business key which
> satisfies some business requirement.
>
> > I'm agree with you : Cake doesn't a whole lot!
> > But it will better if it respects some basical rules, like compound
> > PK... isn't it?
>
> Well, if you think this is an easy thing to do, then go for it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model primarykey

2008-02-25 Thread avairet

Yes Mr Yellow, I don't understand why core team always say "wontfix"?!
Because it's an important issue for me and many others developers,
because that broke the relational model and theory. Additionally,
there is a risk for performances.

We are using Cake to improve productivity and repetitive tasks, but we
are using many other things to reach the same goal, like DbDesigner,
UML, Merise... which respect the relational model. So if we always
rewrite our database to be suitable for Cake, it's not a joke!
We produce web applications which will be "ISO" or "Quality"
certified, so the "Cake hack" for Primary Keys and Reflexive
Associations could be a restraint for that...

I hope this post is understandable and the Cake's community will work
to improve that in 2.0 release...

Avairet



On 25 fév, 02:13, Mr-Yellow <[EMAIL PROTECTED]> wrote:
> The responses to tickets relating to this issue in trac usually have
> "wontfix" and a short non-explainatory note basically saying "piss off
> and stop asking you don't need this, we know best".
>
> -Ben
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-02-25 Thread avairet

@grigri : I understand your comment. Of course, a regex is not a
solution for all alphabets. I thought about "locale" purpose, because
in my case, the regex is simply "/[a-z0-9]$/i" and the accented
characters are validated by Cake!

@Samuel : as soons as I have time for that, I will search a solution
and publish it on trac, of course.

On 15 fév, 18:03, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> perhaps someone familiar with these non-americacentric languanges
> could suggest in a trac ticket a regex query that would include these
> other characters
>
> The check now is for
> $_this->regex = '/[^\\dA-Z]/i';
>
> so suggest the fix to help them, I'm not familiar enough with the
> other languages to be a lot of help
>
> Sam D
>
>
>
> On Fri, Feb 15, 2008 at 9:33 AM, grigri <[EMAIL PROTECTED]> wrote:
>
> >  > But it's anormal for "accented characters" which often exist in French
> >  > or European language and are real letters...
>
> >  "real letters"? By that rationale, all other alphabets should validate
> >  too: from greek to cyrillic and hiragana. Can you imagine the regexp
> >  for that?. I understand your frustration, but "alphanumeric" means
> >  just the base 26 latin letters and 10 arabic numerals, nothing else.
> >  It doesn't mean "valid text in any language known to man". Just how
> >  useful this validation method is remains to be seen...
>
> >  On Feb 15, 4:26 pm,avairet<[EMAIL PROTECTED]> wrote:
> >  > OK! Thank's.
> >  > I've found myself and I've wrote a regular expression!
>
> >  > It's normal "alphaNumeric validation criteria" doesn't work for "blank
> >  > character" which are not "letter" or "number", I'm stupid!
> >  > But it's anormal for "accented characters" which often exist in French
> >  > or European language and are real letters...
>
> >  > BR
>
> >  > Aurélien
>
> >  > On 15 fév, 17:12, Adam Royle <[EMAIL PROTECTED]> wrote:
>
> >  > > This has been reported by others before, but the cake team has said
> >  > > this is the expected functionality. If you're really worried about
> >  > > validating this data then validate the length of the data, otherwise
> >  > > write a custom regex to handle your requirements.
>
> >  > > Cheers,
> >  > > Adam
>
> >  > > On Feb 16, 1:56 am,avairet<[EMAIL PROTECTED]> wrote:
>
> >  > > > Hi,
>
> >  > > > Model : "nature" (id int auto-increment PK / label varchar (50) )
>
> >  > > > var $validate = array(
> >  > > >'label' => array('alphaNumeric')
> >  > > > );
>
> >  > > > Create basic functions in NaturesController (view, add, edit)
>
> >  > > > I launch : "myapp/natures/add"
>
> >  > > > Add new Nature with label "Article" work fine. Data is saved
> >  > > > correctly.
> >  > > > But add label with special characters, like "é" or "-" or blank:
> >  > > > validation failed!
> >  > > > Error message is: 'The Nature could not be saved. Please, try again.
> >  > > > This field cannot be left blank'!?
> >  > > > I've tested with the 1.2.x.x Nightly builds and 1.2.0.6311 and
> >  > > > 1.2.0.5875 releases and the problem remains.
>
> >  > > > Have you noticed that?
>
> >  > > >Avairet
>
> --
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/http://blog.samdevore.com/cakephp-pages/i-cant-bake/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: i18n script ans default.po file

2008-02-22 Thread avairet

OK, but if you want to share translating job between many guys? This
is not handy to have a big "default.po" file.

And I think if the "i18n" script offers the possibility to edit
multiple file, there is a good reason...




On 22 fév, 17:13, leo <[EMAIL PROTECTED]> wrote:
> I just use one file for each language and leave the name as default.
>
> On Feb 22, 4:28 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > OK, thank you Leo!
>
> > I know your point 2.
> > When I use the "i18n" script, I select the good path to my locale:
> > "myapp/locale/fre/LC_MESSAGES/default.po"
>
> > But why the script write ".pot" files instead of ".po"? This is not
> > handy to rename all of ".pot" files...
> > And even if I rename the ".pot" to ".po", my translations are not
> > displayed.
>
> > So I repeat my question: must I put all translated strings in
> > "default.po" files?
>
> > Hope this message is understandable...
>
> > BR
>
> > Avairet
>
> > On 22 fév, 16:17, leo <[EMAIL PROTECTED]> wrote:
>
> > > 1. change all the .POT extensions to .po
> > > 2. each language file should reside in its own directory named
> > > according tohttp://api.cakephp.org/1.2/l10n_8php-source.html#l00180
> > > use the 'locale' value e.g Spain = 'locale' => 'spa', Catalan =
> > > 'locale' => 'cat'
>
> > > so I have:
> > > app/locale/cat/LC_MESSAGES/default.po
> > > app/locale/spa/LC_MESSAGES/default.po
>
> > > 3. there is a good reference 
> > > here:http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis...
>
> > > Good luck!
>
> > > On 22 feb, 15:18, avairet <[EMAIL PROTECTED]> wrote:
>
> > > > Hi everybody,
>
> > > > I'm using Cake "i18n" console script to extract all strings to
> > > > translate.
> > > > There are 2 options for extract: one file or multiple file.
>
> > > > To improve translation and avoid to scroll an enormous file, I choose
> > > > "multiple file", but after files generation, how specify to Cake using
> > > > all my ".POT files" instead of an only one "default.po" file?
>
> > > > Because if my translations are not in "default.po" file, they are not
> > > > displayed in my app...
> > > > I'm using Cake 1.2.x.x nighlty builds
>
> > > > Sorry for my simple English.
>
> > > > Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: i18n script ans default.po file

2008-02-22 Thread avairet

OK, thank you Leo!

I know your point 2.
When I use the "i18n" script, I select the good path to my locale:
"myapp/locale/fre/LC_MESSAGES/default.po"

But why the script write ".pot" files instead of ".po"? This is not
handy to rename all of ".pot" files...
And even if I rename the ".pot" to ".po", my translations are not
displayed.

So I repeat my question: must I put all translated strings in
"default.po" files?

Hope this message is understandable...

BR

Avairet


On 22 fév, 16:17, leo <[EMAIL PROTECTED]> wrote:
> 1. change all the .POT extensions to .po
> 2. each language file should reside in its own directory named
> according tohttp://api.cakephp.org/1.2/l10n_8php-source.html#l00180
> use the 'locale' value e.g Spain = 'locale' => 'spa', Catalan =
> 'locale' => 'cat'
>
> so I have:
> app/locale/cat/LC_MESSAGES/default.po
> app/locale/spa/LC_MESSAGES/default.po
>
> 3. there is a good reference 
> here:http://bakery.cakephp.org/articles/view/p28n-the-top-to-bottom-persis...
>
> Good luck!
>
> On 22 feb, 15:18, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I'm using Cake "i18n" console script to extract all strings to
> > translate.
> > There are 2 options for extract: one file or multiple file.
>
> > To improve translation and avoid to scroll an enormous file, I choose
> > "multiple file", but after files generation, how specify to Cake using
> > all my ".POT files" instead of an only one "default.po" file?
>
> > Because if my translations are not in "default.po" file, they are not
> > displayed in my app...
> > I'm using Cake 1.2.x.x nighlty builds
>
> > Sorry for my simple English.
>
> > Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



i18n script ans default.po file

2008-02-22 Thread avairet

Hi everybody,

I'm using Cake "i18n" console script to extract all strings to
translate.
There are 2 options for extract: one file or multiple file.

To improve translation and avoid to scroll an enormous file, I choose
"multiple file", but after files generation, how specify to Cake using
all my ".POT files" instead of an only one "default.po" file?

Because if my translations are not in "default.po" file, they are not
displayed in my app...
I'm using Cake 1.2.x.x nighlty builds

Sorry for my simple English.

Avairet


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



Re: relations in cake problem

2008-02-18 Thread avairet

HI Andrew,

Yes you can do that!
But you must have "Post model", "Category model" and "Locality model".
Then you put:

var $hasOne = array ('Category'=> array(), 'Locality'=>array());

in your Post model.

After that you write: " var $belongsTo = 'Post'; " in your two other
models.

Hope this helps...

Avairet


On 17 fév, 23:53, andrewharlan <[EMAIL PROTECTED]> wrote:
> Can any1 help me with this? i understand Post $hasone category and
> $hasone locality. but can i set category to $belongsto Post and
> locality as $belongsto Post ??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Validation criteria "alphaNumeric" doesn't accept special chars

2008-02-15 Thread avairet

OK! Thank's.
I've found myself and I've wrote a regular expression!

It's normal "alphaNumeric validation criteria" doesn't work for "blank
character" which are not "letter" or "number", I'm stupid!
But it's anormal for "accented characters" which often exist in French
or European language and are real letters...

BR

Aurélien


On 15 fév, 17:12, Adam Royle <[EMAIL PROTECTED]> wrote:
> This has been reported by others before, but the cake team has said
> this is the expected functionality. If you're really worried about
> validating this data then validate the length of the data, otherwise
> write a custom regex to handle your requirements.
>
> Cheers,
> Adam
>
> On Feb 16, 1:56 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Model : "nature" (id int auto-increment PK / label varchar (50) )
>
> > var $validate = array(
> >'label' => array('alphaNumeric')
> > );
>
> > Create basic functions in NaturesController (view, add, edit)
>
> > I launch : "myapp/natures/add"
>
> > Add new Nature with label "Article" work fine. Data is saved
> > correctly.
> > But add label with special characters, like "é" or "-" or blank:
> > validation failed!
> > Error message is: 'The Nature could not be saved. Please, try again.
> > This field cannot be left blank'!?
> > I've tested with the 1.2.x.x Nightly builds and 1.2.0.6311 and
> > 1.2.0.5875 releases and the problem remains.
>
> > Have you noticed that?
>
> > Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Validation criteria "alphaNumeric" doesn't accept special chars

2008-02-15 Thread avairet

Hi,

Model : "nature" (id int auto-increment PK / label varchar (50) )

var $validate = array(
   'label' => array('alphaNumeric')
);

Create basic functions in NaturesController (view, add, edit)

I launch : "myapp/natures/add"

Add new Nature with label "Article" work fine. Data is saved
correctly.
But add label with special characters, like "é" or "-" or blank:
validation failed!
Error message is: 'The Nature could not be saved. Please, try again.
This field cannot be left blank'!?
I've tested with the 1.2.x.x Nightly builds and 1.2.0.6311 and
1.2.0.5875 releases and the problem remains.

Have you noticed that?

Avairet

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



Unit tests and Bake script

2008-02-15 Thread avairet

Hi,

I'm using 1.2.x.x nightly builds.
I'm using Bake script to generate a simple model called "nature" whith
only 2 fields : id (int auto-increment PK) and label (varchar 50).
I'm generating the NaturesController too with the same way.
Bake create automagically Unit tests for my model and my controller,
good!
I launch 'controllers\natures_controller.test.php': it works fine.
But when I launch test for the model: 'models\nature.test.php', there
is an error!

[code]
Individual test case: models\nature.test.php
Query: CREATE TABLE `natures` ( `id` int(10) DEFAULT NULL
auto_increment, `label` varchar(50) NOT NULL );
Error:  Database table natures for model Nature was not found.
1075: Incorrect table definition; there can be only one auto column
and it must be defined as a key
[/code]

The Test Suite shouldn't create "test_natures" table instead of
'natures'?
The problem exists even I write "var $useDbConfig = 'test' " in
"nature.test.php...

Avairet


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



Bake and Unit tests

2008-02-13 Thread avairet

Hi,

When I generate my app with Bake script and I want baking Unit tests
too, I don't understand all very well...

- must I create two databases and insert same schema into both before
starting Bake? or Bake can create himself the "test tables"?
- must I choose "test" database config at Bake prompt?
- must I make the Bake process 2 times, one for generate Models,
Controllers, Views, Tests cases and fixtures (database config 'test')?
and another one for generate only Models, Controllers, Views (database
default)? it's not very handy?!

Thank's by advance for your opinions about that or for a simple
example/tutorial... and once again, excuse me for my simple frenchy
English.

Avairet

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



Re: Model primarykey

2008-02-13 Thread avairet

I have asked again my SQL gurus about this "hack" using in Cake. Their
answer is :
"adding an Id field is possible, but it will result to a sensible
performance decrease (I/O bound effect)."

Hope this help to improve Cake capacities for the future releases...

Avairet



On 13 fév, 14:25, avairet <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I've read this discussion and asked question about it to an older DBA,
> master of Modelisation and SQL theory since 30 years.
> He says there are a lot of stupidities and many authors need studying
> Modelisation and Theory before posting...
> Only one thing: a Primary Key is not equal to Unique not null index!
>
> I'm agree with you : Cake doesn't a whole lot!
> But it will better if it respects some basical rules, like compound
> PK... isn't it?
>
> So, temporarily, I will add "a dump auto incrementing ID" to my
> relational tables!
>
> Avairet
>
> On 12 fév, 18:19, Baz <[EMAIL PROTECTED]> wrote:
>
> > Here are some interesting discussions:
>
> >http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8..
>
> > Bottom line (from what I gather), it was done so to make Cake work easier.
>
> > I still don't think a lot of people appreciate the fact that Cake does a
> > whole lot! So hey, if I need to add a dump auto incrementing ID, that's what
> > I'm gonna do.
>
> > On Feb 12, 2008 10:48 AM, avairet <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I've the same question.
> > > Cake will never support compound or multiple primary keys?? Why?
> > > How manage this issue?
>
> > > Thanks by advance
>
> > > Avairet
>
> > > On 12 fév, 09:44, "Matias Lespiau" <[EMAIL PROTECTED]> wrote:
> > > > On Feb 12, 2008 3:56 AM, adammc84 <[EMAIL PROTECTED]> wrote:
>
> > > > > if the MySql database table my model is 'modeled' from has a primary
> > > > > key that is user_id,posts_id how do i configure that in cake model to
> > > > > use a dual primary key ?
>
> > > > Hi adammc84,
>
> > > > Cake does not support multiple primary keys.
>
> > > > --
> > > > Matias Lespiauhttp://www.gignus.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model primarykey

2008-02-13 Thread avairet

Hello!

I've read this discussion and asked question about it to an older DBA,
master of Modelisation and SQL theory since 30 years.
He says there are a lot of stupidities and many authors need studying
Modelisation and Theory before posting...
Only one thing: a Primary Key is not equal to Unique not null index!

I'm agree with you : Cake doesn't a whole lot!
But it will better if it respects some basical rules, like compound
PK... isn't it?

So, temporarily, I will add "a dump auto incrementing ID" to my
relational tables!

Avairet



On 12 fév, 18:19, Baz <[EMAIL PROTECTED]> wrote:
> Here are some interesting discussions:
>
> http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8...http://groups.google.com/group/cake-php/browse_thread/thread/4a3f44f8...
>
> Bottom line (from what I gather), it was done so to make Cake work easier.
>
> I still don't think a lot of people appreciate the fact that Cake does a
> whole lot! So hey, if I need to add a dump auto incrementing ID, that's what
> I'm gonna do.
>
> On Feb 12, 2008 10:48 AM, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I've the same question.
> > Cake will never support compound or multiple primary keys?? Why?
> > How manage this issue?
>
> > Thanks by advance
>
> > Avairet
>
> > On 12 fév, 09:44, "Matias Lespiau" <[EMAIL PROTECTED]> wrote:
> > > On Feb 12, 2008 3:56 AM, adammc84 <[EMAIL PROTECTED]> wrote:
>
> > > > if the MySql database table my model is 'modeled' from has a primary
> > > > key that is user_id,posts_id how do i configure that in cake model to
> > > > use a dual primary key ?
>
> > > Hi adammc84,
>
> > > Cake does not support multiple primary keys.
>
> > > --
> > > Matias Lespiauhttp://www.gignus.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Better way to create reflexive association?

2008-02-13 Thread avairet

Hello,

Thank you for answer.

No I haven't tried this, because I thought Cake doesn't accept an
association between 2 models with the same name...
In your example, have you created the "joinTable" before creating
HABTM in the model definition?
Is it possible to link YourModel with YourModel and to have
"foreignKey" and "associationForeignKey" with the same name?

BR

Avairet


On 12 fév, 18:43, "b logica" <[EMAIL PROTECTED]> wrote:
> On Feb 12, 2008 11:46 AM, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi everybody,
>
> > I'm trying to create a "reflexive association", a table HABTM with
> > itself.
> > What is the better way to generate it with Cake?
>
> Have you tried this?
>
> var $name = 'YourModel';
>
> var $hasAndBelongsToMany = array(
> 'YourModel' =>
> array('className'=> 'YourModel',
> 'joinTable'  => 'your_models_your_models',
> 'foreignKey' => 'your_model_id',
> 'associationForeignKey'  => 'your_model_id'
> )
> );
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse + PHP Cake

2008-02-13 Thread avairet

Hi,

Welcome to Cake and Eclipse world!

1) Eclipse validator is not perfect, but you can turn it off like
Renan says. The problem you describe is due to templates includes :
the "body open tag" is locate in another file, so Eclipse doesn't know
that and display a warning!

2) I don't really understand your question... but it seems the same
problem that validator. you can also tunr it off "auto quote close" in
Eclipse/PDT preferences.

Hope this help and excuse me for my simple frenchy English.

Avairet



On 11 fév, 10:03, R <[EMAIL PROTECTED]> wrote:
> Am new to Cake/PHP/ and their Eclipse combination.
>
> Have 2 queries.
>
> 1)
>
> I've grabbed all the code from the svn repository - all of which is
> phpcake 1.2.
>
> Eclipse unfortunately detects a lot of 'problems' in footer.php and
> header.php. As the tags aren't closed.
>
> Error's being:
>
> No start tag ().   footer.php line 37...
>
> and so on.
>
> How do I stop Eclipse from verifying/checking either overall or
> preferably certain directories for errors?
>
> Thank you.
>
> 2)
>
> When I code within Eclipse - it does a great job of code completion as
> well as matching braces and inverted commas. Dilemma I'm having is
> when I type something as simply as:
>
> var $name='User';
>
> when I start adding the first ' - eclipse automatically finishes it
> off with a closing inverted comma, which is great - BUT - how do I tab
> out of it - without having to actually type the symbol?
>
> Hopefully that makes sense.
>
> Any tips are much appreciated.
>
> R,
>
> R
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Model primarykey

2008-02-12 Thread avairet

Hi,

I've the same question.
Cake will never support compound or multiple primary keys?? Why?
How manage this issue?

Thanks by advance

Avairet



On 12 fév, 09:44, "Matias Lespiau" <[EMAIL PROTECTED]> wrote:
> On Feb 12, 2008 3:56 AM, adammc84 <[EMAIL PROTECTED]> wrote:
>
>
>
> > if the MySql database table my model is 'modeled' from has a primary
> > key that is user_id,posts_id how do i configure that in cake model to
> > use a dual primary key ?
>
> Hi adammc84,
>
> Cake does not support multiple primary keys.
>
> --
> Matias Lespiauhttp://www.gignus.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Better way to create reflexive association?

2008-02-12 Thread avairet

Hi everybody,

I'm trying to create a "reflexive association", a table HABTM with
itself.
What is the better way to generate it with Cake?

Thanks by advance for answers...

BR

Avairet


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



Re: CakePHP guide

2008-02-07 Thread avairet

Hi verybody!

I'm really newbie with Cake (since 4 months) and I'm French...

Of course, doc is a negative point for Cake, compared with Symfony or
Zend (and notably for international users they don't read English
easily).
It's harder to find, it's not updated, it's not simple.

But I'm agree with Nate and John : why all documentation efforts
aren't put towards the official documentation? why people criticise
instead of contribute?

Maybe the way to contribute and doc presentation are not very clear.

For example, the "tempdoc" for 1.2 beta is not practical to read : a
long scroll, with blanks in some parts... and nothing to announce
updates, so we must always scroll to find if new things are added.

The Bakery is a good idea, but its organisation is not clear and not
enough efficient.
The structure of information is not logical, not progressive. This is
a catch-all...

Of course, CakePHP is work in progress and the 1.2 is on beta version.
Like John said: create a stable documentation for a beta software is
difficult!

Zoe, your initiative is good, John and Nate, your opinions are right,
so isn't possible to find a common ground and write an only official
doc?
And after that, French, Japanese, German, Spanish and many other
Cakers can translate your prose!

Sorry for my simple English...

Avairet



On Feb 3, 7:01 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote:
> Hi!
>
> Just to let you all know, I've finally written enough of the CakePHP
> guide that I'm working on to warrant putting it online at last. It's
> available here:
>
> http://cakephp.bytenoise.co.uk/
>
> It's only the first three chapters so far, but hopefully I should have
> a lot more there over the next few weeks.
>
> Any comments and constructive criticism are both welcomed.
>
> Thanks,
> Zoe.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: specify field instead of string in conditions array

2008-01-10 Thread avairet

Hello Brian,

Can you explain more? What is your context?
Because "conditions" array is normally for SQL conditions (e.g. :
"Post.id > 5" or "Post.id <> 10"), not for fields...

BR

Avairet



On 10 jan, 02:32, blange <[EMAIL PROTECTED]> wrote:
> $conditions = array(
> 'Post.id' => 'Post.thread_id',
>
> How to I make cake interpret Post.thread_id as the field instead of a
> string.
>
> Thanks.
>
> -Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Some bake problems...

2008-01-10 Thread avairet

I have upgraded the console with nightly build release but problems
always exist...

Avairet



On 10 jan, 11:34, avairet <[EMAIL PROTECTED]> wrote:
> Hi everybody,
>
> I found some problems with bake script in command line.
> I'm using 1.2.0.6311 beta release, not the nightly.
>
> 1) In a controller creation, if I answer "no" for: "Would you like to
> include some basic class methods?", bake doesn't ask me creating Admin
> routing methods...
>
> 2) The validation criteria is not written in the model file!
>
> 3) I can't select multiple validation criterias for one model...
>
> Do you think I will create a ticket or bug report on trac for this
> troubles?
>
> BR
>
> Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Some bake problems...

2008-01-10 Thread avairet

Hi everybody,

I found some problems with bake script in command line.
I'm using 1.2.0.6311 beta release, not the nightly.

1) In a controller creation, if I answer "no" for: "Would you like to
include some basic class methods?", bake doesn't ask me creating Admin
routing methods...

2) The validation criteria is not written in the model file!

3) I can't select multiple validation criterias for one model...

Do you think I will create a ticket or bug report on trac for this
troubles?

BR

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



Re: where to find cakephp developers?

2007-12-18 Thread avairet

Hi Joe!

Here is a special jobs website about Cake: http://withcake.com/

BR

Avairet

On 17 déc, 22:44, joeradical <[EMAIL PROTECTED]> wrote:
> I am looking for the best place to find seasoned cakephp guru's. I am
> rewriting our entire site for cake and may need additional help to
> speed up development. I need someone to make the template, someone to
> look at the old php code and translate it to cakephp and I need
> someone to help add new functions etc.
>
> If you know where to find these people at a reasonable cost it would
> help.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Call to Controller::"referer()" method from a component?

2007-12-17 Thread avairet

Hi Evrybody,

I want use "Controller::referer()" method in a component, is it
possible?

I've tried this (in PHP 5 context):

class MyComponent extends Object {
   public $controller = null;

   public function startup(&$controller) {
$this->controller = &$controller;
   }

   public function MyCustomFunction () {
$var = $this->controller->referer();
   }
}

But it doesn't work... No data is stored in $var.

Why? Have you an idea?
Must I write something in the Controller::beforeFilter() ??

Thank's by advance and sorry for my frenchy simple English!

BR

Avairet


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



Re: Help please for ultra-beginner

2007-12-12 Thread avairet

I add another comment: if you are using Eclipse and PDT Eclipse, the
autocompletion for model's methods in controller doesn't work again.


On 12 déc, 16:07, avairet <[EMAIL PROTECTED]> wrote:
> Ok, that works! Very nice!
>
> But in this case, some of my "find() or save() calls" become more
> complex: $this->Model1->Model2->Model3->save();
> And the resultsets of my find are now in the DESC order...
>
> Avairet
>
> On 12 déc, 15:54, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi Mr Tufty,
>
> > I didn't know that...
> > It's very interesting.
> > I will try it immediately because I've a doubt... that the associated
> > models is known in my controller.
>
> > I will reply after my test!
>
> > Avairet
>
> > On 12 déc, 13:56, MrTufty <[EMAIL PROTECTED]> wrote:
>
> > > Yes, you can do it that way too. But if you set up the associations,
> > > you don't NEED to change $uses to include Ugroup, as it will
> > > automatically be included based on it's association with the User
> > > model.
>
> > > On Dec 12, 9:22 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > My cake knowledge is limited too (2 months), but I think you must
> > > > specify your 2 models in your controller.
>
> > > > Something like that in PHP5 context:
> > > >  > > > class UsersController extends AppController
> > > > {
> > > >public $uses = array('User','Ugroup');}
>
> > > > ?>
>
> > > > And maybe you should specify the association in your 2 models...
>
> > > > Something like that:
> > > >  > > > class User extends AppModel
> > > > {
> > > >public $belongsTo = array('Ugroup');}
>
> > > > ?>
>
> > > > and for the associated model:
>
> > > >  > > > class Ugroup extends AppModel
> > > > {
> > > >public $hasMany = array('User');}
>
> > > > ?>
>
> > > > And finally, you must indicate to your models, the primary key you are
> > > > using, because by default Cake search for an "id" key to make
> > > > associations.
> > > >  > > > class Ugroup extends AppModel
> > > > {
> > > >public $primaryKey = 'ugroup_id';}
>
> > > > ?>
>
> > > > I hope this helps you...
>
> > > > BR
>
> > > > Avairet
>
> > > > On 12 déc, 08:37, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > > > No good im afraid, same error, except ugroup_id is now ugroupid
>
> > > > > 
> > > > > Notice: Undefined property: UsersController::$Ugroup in C:\server\www
> > > > > \cake\basic_site\plugins\users\controllers\users_controller.php on
> > > > > line 34
>
> > > > > Fatal error: Call to a member function findByUgroupid() on a non-
> > > > > object in C:\server\www\cake\basic_site\plugins\users\controllers
> > > > > \users_controller.php on line 34
> > > > > 
>
> > > > > On Dec 12, 7:31 pm, chad <[EMAIL PROTECTED]> wrote:
>
> > > > > > try findByUgroupId
>
> > > > > > On Dec 11, 10:08 pm, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hi
>
> > > > > > > Ive only just started mucking around with CakePHP, and am having a
> > > > > > > little trouble getting my head around the controllers and models
> > > > > > > thingees.  YES - I have tried looking in the manual!!
>
> > > > > > > Im trying to make a cake website that will more or less mirror 
> > > > > > > some
> > > > > > > normal-non-framework php sites I have done.
>
> > > > > > > There is a table called users where all normal user data is stored
> > > > > > > (see below for table structure).  The ugroup table contains a
> > > > > > > ugroup_name and a number of "permissions" that dictate what the 
> > > > > > > user
> > > > > > > will be able to access on the site.  The ugroup_id field in users
> > > > > > > i

Re: Help please for ultra-beginner

2007-12-12 Thread avairet

Ok, that works! Very nice!

But in this case, some of my "find() or save() calls" become more
complex: $this->Model1->Model2->Model3->save();
And the resultsets of my find are now in the DESC order...

Avairet


On 12 déc, 15:54, avairet <[EMAIL PROTECTED]> wrote:
> Hi Mr Tufty,
>
> I didn't know that...
> It's very interesting.
> I will try it immediately because I've a doubt... that the associated
> models is known in my controller.
>
> I will reply after my test!
>
> Avairet
>
> On 12 déc, 13:56, MrTufty <[EMAIL PROTECTED]> wrote:
>
> > Yes, you can do it that way too. But if you set up the associations,
> > you don't NEED to change $uses to include Ugroup, as it will
> > automatically be included based on it's association with the User
> > model.
>
> > On Dec 12, 9:22 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > My cake knowledge is limited too (2 months), but I think you must
> > > specify your 2 models in your controller.
>
> > > Something like that in PHP5 context:
> > >  > > class UsersController extends AppController
> > > {
> > >public $uses = array('User','Ugroup');}
>
> > > ?>
>
> > > And maybe you should specify the association in your 2 models...
>
> > > Something like that:
> > >  > > class User extends AppModel
> > > {
> > >public $belongsTo = array('Ugroup');}
>
> > > ?>
>
> > > and for the associated model:
>
> > >  > > class Ugroup extends AppModel
> > > {
> > >public $hasMany = array('User');}
>
> > > ?>
>
> > > And finally, you must indicate to your models, the primary key you are
> > > using, because by default Cake search for an "id" key to make
> > > associations.
> > >  > > class Ugroup extends AppModel
> > > {
> > >public $primaryKey = 'ugroup_id';}
>
> > > ?>
>
> > > I hope this helps you...
>
> > > BR
>
> > > Avairet
>
> > > On 12 déc, 08:37, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > > No good im afraid, same error, except ugroup_id is now ugroupid
>
> > > > 
> > > > Notice: Undefined property: UsersController::$Ugroup in C:\server\www
> > > > \cake\basic_site\plugins\users\controllers\users_controller.php on
> > > > line 34
>
> > > > Fatal error: Call to a member function findByUgroupid() on a non-
> > > > object in C:\server\www\cake\basic_site\plugins\users\controllers
> > > > \users_controller.php on line 34
> > > > 
>
> > > > On Dec 12, 7:31 pm, chad <[EMAIL PROTECTED]> wrote:
>
> > > > > try findByUgroupId
>
> > > > > On Dec 11, 10:08 pm, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi
>
> > > > > > Ive only just started mucking around with CakePHP, and am having a
> > > > > > little trouble getting my head around the controllers and models
> > > > > > thingees.  YES - I have tried looking in the manual!!
>
> > > > > > Im trying to make a cake website that will more or less mirror some
> > > > > > normal-non-framework php sites I have done.
>
> > > > > > There is a table called users where all normal user data is stored
> > > > > > (see below for table structure).  The ugroup table contains a
> > > > > > ugroup_name and a number of "permissions" that dictate what the user
> > > > > > will be able to access on the site.  The ugroup_id field in users
> > > > > > indicates which ugroup the user belongs to.
>
> > > > > > When the person logs in, I first want it to check that the user_name
> > > > > > and user_pass are valid, then access the ugroups table to set the
> > > > > > ugroup data (permissions) as sessions, which can then be called 
> > > > > > when I
> > > > > > like throughout the rest of the site.
>
> > > > > > users_controller.php
> > > > > > -
> > > > > >  > > > > > class UsersController extends AppController
&

Re: Help please for ultra-beginner

2007-12-12 Thread avairet

Hi Mr Tufty,

I didn't know that...
It's very interesting.
I will try it immediately because I've a doubt... that the associated
models is known in my controller.

I will reply after my test!

Avairet



On 12 déc, 13:56, MrTufty <[EMAIL PROTECTED]> wrote:
> Yes, you can do it that way too. But if you set up the associations,
> you don't NEED to change $uses to include Ugroup, as it will
> automatically be included based on it's association with the User
> model.
>
> On Dec 12, 9:22 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > My cake knowledge is limited too (2 months), but I think you must
> > specify your 2 models in your controller.
>
> > Something like that in PHP5 context:
> >  > class UsersController extends AppController
> > {
> >public $uses = array('User','Ugroup');}
>
> > ?>
>
> > And maybe you should specify the association in your 2 models...
>
> > Something like that:
> >  > class User extends AppModel
> > {
> >public $belongsTo = array('Ugroup');}
>
> > ?>
>
> > and for the associated model:
>
> >  > class Ugroup extends AppModel
> > {
> >public $hasMany = array('User');}
>
> > ?>
>
> > And finally, you must indicate to your models, the primary key you are
> > using, because by default Cake search for an "id" key to make
> > associations.
> >  > class Ugroup extends AppModel
> > {
> >public $primaryKey = 'ugroup_id';}
>
> > ?>
>
> > I hope this helps you...
>
> > BR
>
> > Avairet
>
> > On 12 déc, 08:37, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > No good im afraid, same error, except ugroup_id is now ugroupid
>
> > > 
> > > Notice: Undefined property: UsersController::$Ugroup in C:\server\www
> > > \cake\basic_site\plugins\users\controllers\users_controller.php on
> > > line 34
>
> > > Fatal error: Call to a member function findByUgroupid() on a non-
> > > object in C:\server\www\cake\basic_site\plugins\users\controllers
> > > \users_controller.php on line 34
> > > 
>
> > > On Dec 12, 7:31 pm, chad <[EMAIL PROTECTED]> wrote:
>
> > > > try findByUgroupId
>
> > > > On Dec 11, 10:08 pm, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi
>
> > > > > Ive only just started mucking around with CakePHP, and am having a
> > > > > little trouble getting my head around the controllers and models
> > > > > thingees.  YES - I have tried looking in the manual!!
>
> > > > > Im trying to make a cake website that will more or less mirror some
> > > > > normal-non-framework php sites I have done.
>
> > > > > There is a table called users where all normal user data is stored
> > > > > (see below for table structure).  The ugroup table contains a
> > > > > ugroup_name and a number of "permissions" that dictate what the user
> > > > > will be able to access on the site.  The ugroup_id field in users
> > > > > indicates which ugroup the user belongs to.
>
> > > > > When the person logs in, I first want it to check that the user_name
> > > > > and user_pass are valid, then access the ugroups table to set the
> > > > > ugroup data (permissions) as sessions, which can then be called when I
> > > > > like throughout the rest of the site.
>
> > > > > users_controller.php
> > > > > -
> > > > >  > > > > class UsersController extends AppController
> > > > > {
>
> > > > > function login()
> > > > > {
> > > > > $this->set('error', false);
>
> > > > > if (!empty($this->data))
> > > > > {
> > > > > $someone = 
> > > > > $this->User->findByUser_name($this->data['User']
> > > > > ['user_name']);
>
> > > > > if(!empty($someone['User']['user_pass']) &&
> > > > > $someone['User']['user_pass'] == md5($this->data['User']
> > > > > ['user_pass

Translate months name in $form->dateTime select

2007-12-12 Thread avairet

Hi everybody,

I'm trying to translate the months names in the dateTime select, which
is generated by $form->input;
I know that using "setlocale" PHP function is a good solution, but
where can I set this locale to avoid to modify the core Form helper
itself?
How can I pass the list of months with their name translated to input
or select or dateTime functions?

I've made a new Helper called "LocaltimeHelper" to manage the local
date formats, but I don't know how handle the FormHelper functions to
get translated select elements?

Thanks by advance for your opinions about that.

BR

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



Re: Help please for ultra-beginner

2007-12-12 Thread avairet

Hello,

My cake knowledge is limited too (2 months), but I think you must
specify your 2 models in your controller.

Something like that in PHP5 context:


And maybe you should specify the association in your 2 models...

Something like that:


and for the associated model:



And finally, you must indicate to your models, the primary key you are
using, because by default Cake search for an "id" key to make
associations.


I hope this helps you...

BR

Avairet

On 12 déc, 08:37, Sanfly <[EMAIL PROTECTED]> wrote:
> No good im afraid, same error, except ugroup_id is now ugroupid
>
> 
> Notice: Undefined property: UsersController::$Ugroup in C:\server\www
> \cake\basic_site\plugins\users\controllers\users_controller.php on
> line 34
>
> Fatal error: Call to a member function findByUgroupid() on a non-
> object in C:\server\www\cake\basic_site\plugins\users\controllers
> \users_controller.php on line 34
> 
>
> On Dec 12, 7:31 pm, chad <[EMAIL PROTECTED]> wrote:
>
> > try findByUgroupId
>
> > On Dec 11, 10:08 pm, Sanfly <[EMAIL PROTECTED]> wrote:
>
> > > Hi
>
> > > Ive only just started mucking around with CakePHP, and am having a
> > > little trouble getting my head around the controllers and models
> > > thingees.  YES - I have tried looking in the manual!!
>
> > > Im trying to make a cake website that will more or less mirror some
> > > normal-non-framework php sites I have done.
>
> > > There is a table called users where all normal user data is stored
> > > (see below for table structure).  The ugroup table contains a
> > > ugroup_name and a number of "permissions" that dictate what the user
> > > will be able to access on the site.  The ugroup_id field in users
> > > indicates which ugroup the user belongs to.
>
> > > When the person logs in, I first want it to check that the user_name
> > > and user_pass are valid, then access the ugroups table to set the
> > > ugroup data (permissions) as sessions, which can then be called when I
> > > like throughout the rest of the site.
>
> > > users_controller.php
> > > -
> > >  > > class UsersController extends AppController
> > > {
>
> > > function login()
> > > {
> > > $this->set('error', false);
>
> > > if (!empty($this->data))
> > > {
> > > $someone = $this->User->findByUser_name($this->data['User']
> > > ['user_name']);
>
> > > if(!empty($someone['User']['user_pass']) &&
> > > $someone['User']['user_pass'] == md5($this->data['User']
> > > ['user_pass']))
> > > {
> > > $this->Session->write('User', $someone['User']);
>
> > > // Here is the code that is giving me 
> > > problems
> > > $perms = 
> > > $this->Ugroup->findByUgroup_id($someone['User']
> > > ['user_group']);
>
> > > if($perms['Ugroup']['perm_admin'] == "1"){
> > > $this->redirect('/pages/admin/');
> > > }
> > > else{
> > > $this->redirect('/');
> > > }
> > > // End Problem code
> > > }
> > > else
> > > {
> > >$this->set('error', true);
> > > }
> > > }
> > > }
>
> > > function logout()
> > > {
> > >$this->Session->delete('User');
>
> > > $this->redirect('/');
> > > }}
>
> > > ?>
>
> > > --
> > > However, this code gives me an error:
>
> > > --
> > > Notice: Undefined property: UsersController::$Ugroup in C:\server\www
> > > \cake\basic_site\plugins\users\controllers\users_controller.ph

Where write "setlocale" to custom date in all the application?

2007-12-10 Thread avairet

Hi,

I'm using $form->input() to create a date field in a form.

Cake create fine 3 selects (one for Days, one for Month and one for
Year) and with "cleanUpFields" method it save my date very well. But I
would translate the names of month in French.

It's work fine if I use "setlocale" directly in the dateTime method of
FormHelper, but it's not a good practice to modify the Cake's original
helper.

So where can I write "setlocale" to translate date in alla of my
application?
In AppHelper? In "config/core.php"? another place?

Thanks for help and sorry for my simple frenchy English.

BR

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



Extends a core helper?

2007-12-10 Thread avairet

Hi everybody,

In the "Cake Philosophy", is it correct to extend an existent Helper
to overwrite some methods?

For example to write a file like this:



Thanks by advance for your opinions about that!

BR

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



Using form helper without model?

2007-11-30 Thread avairet

Hi everybody,

I'm looking for a trick to use a form without a model.
My form doesn't save POST'ed variables in a table, it just save them
in session to simply display on another page.

But when I make "$form->create(null);", all field's names contain the
name of the current model, like "data[Model][Fieldname]" in the HTML
form...

How avoid this? I would juste have something like "data[Fieldname]"...

For example (where current model is "Magazine"):
$form->create(null);
$form->input('Rubrique');
$form->end('Valider');

And the HTML result is:

Rubrique




And what I want ("Magazine" model never appear):

Rubrique




Thank's in advance and excuse me for my simple frenchy English!

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



Re: Eclipse code completion in Views

2007-11-26 Thread avairet

Hello Michael,

All it's clear for Code completion now and I will search the better
method to get this completion in Eclipse PDT, whitout surcharging
files.

Otherwise my question about "Helpers/Components" loading is not about
the Code completion but about Cake himself!
Because of sentence in your post at 16 november: "Now here we have the
problem that the stuff in these arrays is actually loaded."
But it does not matter, I will baking again and again to understand
very well, how to make a good cooking ;o))

Thank's again for your sympathy!

Aurélien



On 21 nov, 18:16, schneimi <[EMAIL PROTECTED]> wrote:
> Hi Aurélien,
>
> > Hi Michael and thank you very much for your baking advice!
>
> You're very welcome!
>
> > For a small application like yours, obviously it's nice to write all
> > PHPDoc comments for Models in AppController and more nice if nothing
> > is loading!
> > But in my case, the application is big and we are 4 developpers to
> > code... so I think it's not good to surcharge the AppController file
> > with many PHPDocs comments.
> > Because the file will become unreadable and because we don't know all
> > the models we are using or we will use along the application's life.
> > (Sorry, I'm not sure this sentence is clear?!)
>
> I agree, it's not nice to have that code in the AppController, but
> it's at least one central place where you can put it, update it and if
> you want, remove it before delivering. You can also put it in the root
> Controller-Class so it will not appear directly in your application,
> but you will always have to update that code along the development.
>
> > Otherwise, why Helpers/Components are loaded and Models are not?
>
> Helpers aren't loaded either (Components are treated like Models), in
> this case it's code that is even never executed (because of the
> exit()). So both times it's pretty much nothing but useless code to
> get eclipse doing thecompletion.
>
> The difference is that one time you want thecompletionon certain
> class-variables ($this->...), the other time you want to have thecompletionin 
> your views on basically undefined variables.
>
> Happy baking,
>
> Michael
>
> avairet schrieb:
>
> > Hi Michael and thank you very much for your baking advice!
>
> > For a small application like yours, obviously it's nice to write all
> > PHPDoc comments for Models in AppController and more nice if nothing
> > is loading!
> > But in my case, the application is big and we are 4 developpers to
> > code... so I think it's not good to surcharge the AppController file
> > with many PHPDocs comments.
> > Because the file will become unreadable and because we don't know all
> > the models we are using or we will use along the application's life.
> > (Sorry, I'm not sure this sentence is clear?!)
>
> > Otherwise, why Helpers/Components are loaded and Models are not?
>
> > Bye,
>
> > Aur�lien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp-fr

2007-11-26 Thread avairet

Hello Kanian,

This discussion is now on the Cakephp-fr Groups: 
http://groups.google.com/group/cakephp-fr
You're welcome!

Aurélien

On 26 nov, 11:47, kanian <[EMAIL PROTECTED]> wrote:
> Have you registered the domain as yours yet?
> I do speak french, and eventhough I am not a Cake expert, I believe
> that translating the docs is a doable task. I can commit myself to
> such a project. Still as avairet says, there needs to be leadership.
> Why not you? Since it's your idea... I am now waiting for you to launh
> the website, to make clear what are the role to play when we engage
> ourselves.
> Donc je n'attend que ton signal.
>
> On Nov 24, 10:46 am, pluriels <[EMAIL PROTECTED]> wrote:
>
> > cakephp-fr.org will be free tomorrow !
> > I wanted the reuse the domain name because of the Search Engine
> > Optimisation.
>
> > It will be faster with the existing backlinks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp-fr

2007-11-26 Thread avairet

Bonjour à tous !

Oui, parlons un peu français, puisque nous sommes sur ce post pour
évoquer une communauté francophone autour de Cake !

J'utilise Cake depuis deux mois environ, suite à une décision du chef
de projet de la boîte où je suis actuellement en mission.
Et l'une des difficultés importantes que nous ayons eu à traiter était
bien sûr le manque de documentation et d'entraide en français.
Le site cakepourtous.org est un bon début pour installer et débuter
avec Cake, mais il est évident qu'il n'a pas été mis à jour récemment.
Son auteur intervient dans la Bakery et parfois sur ce groupe il me
semble. L'avez-vous contacté ?

Le gros problème de l'engagement, même restreint, dans une communauté,
c'est le temps disponible !
Or, la plupart d'entre nous ne peuvent pas consacrer beaucoup de temps
à cela, soit qu'ils aient un job prenant, soit qu'ils aient des
projets personnels également prenant... Il faut donc un "leader" ou un
"groupe leader", qui puisse donner beaucoup de son temps à la
communauté.

Pour ma part, je suis vivement intéressé par la participation à une
communauté OpenSource. C'est un atout et un enrichissement pour un
développeur.
Pourquoi pas celle de Cake ? Il est vrai que ce framework mérite
d'être mieux connu et plus utilisé, comparativement à Symfony.

Alors, si un élan communautaire solide se dessine, je suis prêt à
donner un peu de mon temps, sur le boulot et sur mes loisirs.
Toutefois, mon niveau actuel avec Cake ne m'autorise pas à aider sur
les aspects très technique/programmation, mais je peux aider pour des
petites traductions, des tutos sur l'installation, la configuration,
l'utilisation avec Eclipse/PDT/Subclipse, intégration FCKEditor... Des
collègues seraient égaklement intéressés.

Tenez moi informé.

Aurélien


On 24 nov, 09:46, pluriels <[EMAIL PROTECTED]> wrote:
> cakephp-fr.org will be free tomorrow !
> I wanted the reuse the domain name because of the Search Engine
> Optimisation.
>
> It will be faster with the existing backlinks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse code completion in Views

2007-11-21 Thread avairet

Hi Michael and thank you very much for your baking advice!

For a small application like yours, obviously it's nice to write all
PHPDoc comments for Models in AppController and more nice if nothing
is loading!
But in my case, the application is big and we are 4 developpers to
code... so I think it's not good to surcharge the AppController file
with many PHPDocs comments.
Because the file will become unreadable and because we don't know all
the models we are using or we will use along the application's life.
(Sorry, I'm not sure this sentence is clear?!)

Otherwise, why Helpers/Components are loaded and Models are not?

Bye,

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



Re: Difference between Session helper and Session component?

2007-11-21 Thread avairet

Hello Grant and thank you very much for your attention and answer!

First, I have not read with precision the SessionHelper's write()
method, sorry for my confusion...
Then, I better understand the difference between this two Session
handlers. It's just a matter of utility!

But when I use a new methodology or new programming technique, I need
to understand all its logic and in this case it was illogical for me!

In my job we are trying to separate Controllers development and Views
design, so I thought using SessionHelper was not in line with this
principle, because the intregator/designer must know PHP's sessions
and/or Helper's methods/properties to create his views.

So I must avoid to be a fundamentalist of MVC ;o)

Avairet




On 21 nov, 00:31, Grant Cox <[EMAIL PROTECTED]> wrote:
> Obviously, component is for controllers, helper is for views.  The
> reason for the helper is that often view output depends on what is in
> the session, and it can get a little tedious set()'ing everything from
> the session out for the view, in the app_controller beforeFilter
> ("just in case" the view needs it for this request).
>
> You will notice that the session helper is read only - you cannot
> write from the view.  So while it may be a little against the grain of
> MVC, it is also very handy :)
>
> On Nov 20, 8:01 pm, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody,
>
> > I'm relatively newbie with Cake 1.2 and I don't understand very well
> > the difference between Session Helper and Session Component, which
> > have some common methods.
> > Is this againsts the 'DRY' (don't repeat yourself) rule?
> > Why using "write" and "read" Session method in a view? This is
> > normally controller's job, isn't it?
> > Can you explain the difference or show me an example of Session usage
> > with component and helper?
> > Thank's by advance and excuse me for my simple English.
>
> > BR
>
> > Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake Vendors directory access?

2007-11-21 Thread avairet

Hello and thank's for help!

My "vendor call" is: vendor('file_name');
Not including ".php" in the call.
My file is not in a subfolder, but my Cake's core folder and my App
folder and Webroot are separate.
I'm using Cake 1.2.0.5875 pre-beta, on Windows XP with Apache 2/PHP
5.2/MySQL 5.
I will test again... maybe it's just a path error.

BR

Avairet



On 21 nov, 05:54, Grant Cox <[EMAIL PROTECTED]> wrote:
> I have no idea why it doesn't work for you, it works fine here.  Are
> you sure you aren't including the ".php" part of the filename in your
> vendor call?  Is your file in a subfolder or anything?  What version
> of Cake are you using?
>
> The vendor() function is defined in /cake/basics.php, and is not very
> complex.  Throw some log() statements in there, you should figure out
> what is going wrong.
>
> On Nov 20, 11:21 pm, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hello,
>
> > If I put a php file in "cake/vendors" directory, when I try to include
> > it by using "vendor(my_php_file)" in a controller or a helper, this
> > doesn't work... I must put my php file in "app/vendors" directory to
> > access it.
> > So to share an external PHP library in all my cake applications, I
> > must copy this library in all apps directories, this is not useful!
>
> > Why the cake/vendors directory doesn't work correctly?
>
> > I need to point out that my Cake directory and apps directories are
> > separated.
>
> > Avairet
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Cake Vendors directory access?

2007-11-20 Thread avairet

Hello,

If I put a php file in "cake/vendors" directory, when I try to include
it by using "vendor(my_php_file)" in a controller or a helper, this
doesn't work... I must put my php file in "app/vendors" directory to
access it.
So to share an external PHP library in all my cake applications, I
must copy this library in all apps directories, this is not useful!

Why the cake/vendors directory doesn't work correctly?

I need to point out that my Cake directory and apps directories are
separated.

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



Difference between Session helper and Session component?

2007-11-20 Thread avairet

Hi everybody,

I'm relatively newbie with Cake 1.2 and I don't understand very well
the difference between Session Helper and Session Component, which
have some common methods.
Is this againsts the 'DRY' (don't repeat yourself) rule?
Why using "write" and "read" Session method in a view? This is
normally controller's job, isn't it?
Can you explain the difference or show me an example of Session usage
with component and helper?
Thank's by advance and excuse me for my simple English.

BR

Avairet


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



Re: Eclipse code completion in Views

2007-11-16 Thread avairet

OK, thank's Michael!

But is it a good idea to "load" all models in AppController whereas
this models are not used in all Controllers that extends
AppController?
Or your trick doesn't "load" the models but just indicates it for code
completion to PDT Eclipse?

In the same way, HtmlHelper is declared in CakeCore's Controller Class
so it's not necessary to write "$helpers = array('html');" in our own
controllers, views and helpers? In this case, why couldn't we write
all available Models, Helpers, Components in a unique place (e.g.
AppController)?
Because in practice, there are a lot of same declarations, like
'$helpers = array('html','form')", in our applications!

I'm sorry but this kind of details are not trivial for me...

Thank's for explanations...

Aurélien


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



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

I've resolved the problem with code completion in SVN project!
In my SVN repository, there was a file called ".project" (an error of
my collegues), so when I checked out, Subclipse did never ask me what
kind of project I want to create! I've deleted it and now all work
fine!

Thank's to Hannes and Nagy for their answers which have enlighten me
about the ways to explore!

The steps:
1. create and connect to a SVN Repository via the SVN Repository
Exploring perspective
2. right-click on the repository, choose "Checkout"
3. check the first radio button "check out as a project configured
using the New Project Wizard" and click "Finish" button.
4. in the wizard select window, choose "PHP>PHP project" and then
click "Next" button
5. select where you want to store the project and name it (for me, the
location is not the default workspace, so I uncheck the radio button
and select the directory in my file system)
6. click next to include Cakephp core
7. return to your PHP perspective where a new project is now available
on the left panel
8. edit or create a file : all Eclipse PDT plugin utilities are
available!
9. use "Voidstate" method (describe above) to get helpers
autocompletion in views and Michael "Schneimi" trick to get models/
components methods autocompletion in your controllers.
GREAT !!!

Aurélien (avairet)


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



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

Michael,

Sorry, I've made an error in code. This is the code I write in my
AppController (var $model):

[code]
class AppController extends Controller {
  /**
   * @var Model
   */
var $model
}
[/code]

Otherwise, I've tested your solution for SVN, but it doesn't work.
Even I use "Import SVN" in an existing PHP project, no code completion
is available, even PHP built'in functions like "mysql_close" or
"str_replace" are unavailable!

Moreover, the Eclipse Outline View doesn't work too with a SVN
checkout project! It's impossible to take some Eclipse/PDT utilities
with that kind of project!
Currently I think create 2 projects in Eclipse: one for SVN checkout
and one for my real web project. And then I will merge all files
before making my SVN commits...

See you another solution?

BR,

Aurélien (avairet)




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



Re: Eclipse code completion in Views

2007-11-14 Thread avairet

Hello Michael,

Thank's a lot for your answer. I've just need some precisions:

>>> Model completion works in all controllers for me with the phpdoc in
the AppController. Maybe your controllers extend Controller and not
AppController.

No, my controllers extends AppController. e.g. :

[code]
class ArticlesController extends AppController {
public $name = 'Articles';
}
[/code]

If I write this in my AppController class, the code completion doesn't
work in the controller "ArticlesController":
[code]
class AppController extends Controller {
  /**
   * @var Model
   */
var Model
}
[/code]

Must I write the name of all my models with PHPDoc in AppController?


>>>>I use to create a PHP
project first and then use the import for that project to get the data
from SVN.

OK, I will test that.


>>>>t should be possible to extend the completion to the other stuff,
e.g. this works for the Session-Component.

Must I write the PHPDoc comment in all my controllers which are using
SessionComponent? Or I must write it in AppController too?

I hope my message is understandable...

Have a nice day !

Aurélien (avairet)



On 13 nov, 18:47, schneimi <[EMAIL PROTECTED]> wrote:
> Hi Avairet,
>
> > - the "schneimi"'s method for modelscompletionin controllers works
> > fine, but it's necessary to copy it in each controllers you create and
> > replace "model" by your model name... I've tried to put this in
> > AppController, but it doesn't work. Any ideas to addcompletionfor
> > all controllers in one place?
>
> Modelcompletionworks in all controllers for me with the phpdoc in
> the AppController. Maybe your controllers extend Controller and not
> AppController.
>
> > - this 2 methods doesn't work if I use Subclipse and check out a cake
> > app directory as an Eclipse project. In this case, there are no code
> >completion, even Php builtin functions! Any ideas why codecompletion
> > doesn't work with a SVN shared project?
>
> I also remember problems with SVN checkout as a project, it seems like
> it isn't handled as a PHP project that way. I use to create a PHP
> project first and then use the import for that project to get the data
> from SVN.
>
> > - and last, is it possible to take codecompletionfor "components'",
> > "behaviors", "elements" and so on?
>
> It should be possible to extend thecompletionto the other stuff,
> e.g. this works for the Session-Component:
>   /**
>* @var SessionComponent
>*/
>   var $Session;
>
> -
> Michael
>
> On 13 Nov., 17:56, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi everybody!
>
> > Firstly, excuse me for my simple English...
>
> > Then I tell you my own experience with PDT/Cake CodeCompletion.
> > My config : Eclipse Europa 3.3 + PDT 1.0 + Cake 1.2 with advanced
> > install/config("Cake core", "app dir" and "webroot dir" in three
> > different paths) )
>
> > - the "voidstate" example is very cool for helpers methodscompletion
> > in view (file with $helper = new Helper())
>
> > - the "schneimi"'s method for modelscompletionin controllers works
> > fine, but it's necessary to copy it in each controllers you create and
> > replace "model" by your model name... I've tried to put this in
> > AppController, but it doesn't work. Any ideas to addcompletionfor
> > all controllers in one place?
>
> > - this 2 methods doesn't work if I use Subclipse and check out a cake
> > app directory as an Eclipse project. In this case, there are no code
> >completion, even Php builtin functions! Any ideas why codecompletion
> > doesn't work with a SVN shared project?
>
> > - and last, is it possible to take codecompletionfor "components'",
> > "behaviors", "elements" and so on?
>
> > Thank's for your kind attention and best regards!
>
> > Avairet
>
> > On 15 oct, 05:35, Mandy <[EMAIL PROTECTED]> wrote:
>
> > > I use Easy Eclipse for PHP. I created eclipse_helper.php, copied all
> > > of the above and pasted it in the file. Then placed the file in
> > > webroot folder, did a Project->Clean->Build (made sure .thtml files
> > > are opened by PHP editor).
>
> > > However, I still couldn't see codecompletionwhen I typed $html->
> > > (and then ctrl + space).
>
> > > ?
>
> >  > -Mandy.


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



Re: Eclipse code completion in Views

2007-11-13 Thread avairet

Hi everybody!

Firstly, excuse me for my simple English...

Then I tell you my own experience with PDT/Cake Code Completion.
My config : Eclipse Europa 3.3 + PDT 1.0 + Cake 1.2 with advanced
install/config("Cake core", "app dir" and "webroot dir" in three
different paths) )

- the "voidstate" example is very cool for helpers methods completion
in view (file with $helper = new Helper())

- the "schneimi"'s method for models completion in controllers works
fine, but it's necessary to copy it in each controllers you create and
replace "model" by your model name... I've tried to put this in
AppController, but it doesn't work. Any ideas to add completion for
all controllers in one place?

- this 2 methods doesn't work if I use Subclipse and check out a cake
app directory as an Eclipse project. In this case, there are no code
completion, even Php builtin functions! Any ideas why code completion
doesn't work with a SVN shared project?

- and last, is it possible to take code completion for "components'",
"behaviors", "elements" and so on?

Thank's for your kind attention and best regards!

Avairet



On 15 oct, 05:35, Mandy <[EMAIL PROTECTED]> wrote:
> I use Easy Eclipse for PHP. I created eclipse_helper.php, copied all
> of the above and pasted it in the file. Then placed the file in
> webroot folder, did a Project->Clean->Build (made sure .thtml files
> are opened by PHP editor).
>
> However, I still couldn't see code completion when I typed $html->
> (and then ctrl + space).
>
> ?
>
> -Mandy.


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



Re: How to use "vendors" directory to share Fckeditor?

2007-11-12 Thread avairet

Hello!

Thank's for your reply. My question wasn't clear...
Of course, "editor directory" and "fckconfig.js", "fckeditor.js",
"fcktemplates.xml",  "fckstyles.xml" must be in "webroot/js/" because
of the client javascript!

My real problem is that if I put "fckeditor.php" file (the class) in
"cake/vendors", the class is not found in my Helper.
But, if I put "fckeditor.php" in "app/vendors", that's OK.
For only one app is good, but to share cake core between many app,
this would be better to share fckeditor too.

Excuse me for my simple English, I hope my post is understandable...

BR

Avairet




On 9 nov, 19:12, chad <[EMAIL PROTECTED]> wrote:
> I have been unsuccessful with using fckeditor from the vendors
> directory as well.  I think fckeditor servers html as well as js, so I
> don't think that the vendors dir is equiped for such a complex
> javascript app.  I solved this buy writing a really simple rsync
> script to copy fckeditor to all of my apps' webroot/js dir.
>
> On Nov 9, 9:01 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > My Cake 1.2 installation:
>
> > - "Cake core" and "vendors dir" are in 'C:/WEB/cake'
>
> > - "App dir" is in 'C:/WEB/cake_apps/caketests'
>
> > - "Webroot dir" is in 'C:/WEB/www/caketests' (in the web server
> > document root).
>
> > I want use Fckeditor and share between multi-app.
> > So I copy FCK "editor dir", "fckconfig.js", "fckeditor.php", etc. in
> > 'C:/WEB/cake/vendors/fckeditor/
>
> > Then I write "vendor('fckeditor')" at the top of my controller.
> > But when I try to instanciate my Fckeditor object in a helper/view,
> > Cake answer me "Class 'FCKeditor' not found"?!
> > Same problem if I write "vendor('fckeditor')" in my view or in my
> > helper...
>
> > How can I do that?
>
> > HELPER :
>
> > class FckeditorHelper extends Helper {
> > public function load ($editor_name,$dimensions = array(),$toolbar =
> > 'Default') {
> > if (empty($dimensions))
> > {
> > $dimensions['width'] = 500;
> >     $dimensions['height'] = 300;
> > }
> > $my_editor = new FCKeditor($editor_name);
> > $my_editor->BasePath =
> > 'c:'.DS.'WEB'.DS.'cake'.DS.'vendors'.DS.'fckeditor/';
> > $my_editor->Width = $dimensions['width'];
> > $my_editor->Height = $dimensions['height'];
> > $my_editor->ToolbarSet = $toolbar;
> > $this->controller->set('fckeditor', $my_editor);
> > }
>
> > }
>
> > Avairet


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



How to use "vendors" directory to share Fckeditor?

2007-11-09 Thread avairet

Hi,

My Cake 1.2 installation:

- "Cake core" and "vendors dir" are in 'C:/WEB/cake'

- "App dir" is in 'C:/WEB/cake_apps/caketests'

- "Webroot dir" is in 'C:/WEB/www/caketests' (in the web server
document root).

I want use Fckeditor and share between multi-app.
So I copy FCK "editor dir", "fckconfig.js", "fckeditor.php", etc. in
'C:/WEB/cake/vendors/fckeditor/

Then I write "vendor('fckeditor')" at the top of my controller.
But when I try to instanciate my Fckeditor object in a helper/view,
Cake answer me "Class 'FCKeditor' not found"?!
Same problem if I write "vendor('fckeditor')" in my view or in my
helper...

How can I do that?

HELPER :

class FckeditorHelper extends Helper {
public function load ($editor_name,$dimensions = array(),$toolbar =
'Default') {
if (empty($dimensions))
{
$dimensions['width'] = 500;
$dimensions['height'] = 300;
}
$my_editor = new FCKeditor($editor_name);
$my_editor->BasePath =
'c:'.DS.'WEB'.DS.'cake'.DS.'vendors'.DS.'fckeditor/';
    $my_editor->Width = $dimensions['width'];
$my_editor->Height = $dimensions['height'];
$my_editor->ToolbarSet = $toolbar;
$this->controller->set('fckeditor', $my_editor);
}
}

Avairet


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



Re: display validation error messages for textarea?

2007-11-09 Thread avairet

OK AD! Thank's for your help.

>>>>How so? Irrespective of how html represents it, it's user input.
Yes, all fields in a form are "user input", but in (X)HTML and
semantic context, a "textarea" is different to a "text input"!
And if a method is called "textarea" and an other "input", the
developer is tempted using each to keep some coherence with HTML
syntax...

I've understood "inputs" method, but I've made some tests and it
didn't work fine... I'll try it again.

BR,

Avairet



On 9 nov, 11:12, AD7six <[EMAIL PROTECTED]> wrote:
> On Nov 9, 10:13 am, avairet <[EMAIL PROTECTED]> wrote:
>
> > Hello and thank's for replies!
>
> > Do you know if it's scheduled to optimize the "$form->textarea" method
> > in next releases?
> > Because is not "natural" using "$form->input" for this kind of
> > field...
>
> How so? Irrespective of how html represents it, it's user input.
>
> Try some more cakey code, you might like it:
>
> [code]
> Ajout article
>  echo $errorMessage;
> echo $form->create('Article');
> echo $form->inputs(
>  'Article.titre',
>  'Article.sous_titre',
>  'Article.chapeau', // /*Only if the default isn't what you want
> */ => array('type' => 'x'),
>  'Article.contenu',
>  'Article.auteur',
> );
> echo $form->submit('Enregistrer);
> echo $form->end();
> ?>
> [/code]
>
> Note that
>  inputs just calls input in a loop with whatever you pass it.
>  you only need to define params where the defaults are not what you
> want. and it looks like you only want the defaults.
>
> > and it's not practical using 3 instructions instead of 1!
>
> So stop using the building block methods and use input/inputs instead.
>
> > The same problem exists within "$form->checkbox"...
>
> By design ;)
>
> hth,
>
> AD
>
>
>
> > Bye
>
> > Avairet
>
> > On 8 nov, 19:45, Radish <[EMAIL PROTECTED]> wrote:
>
> > > maybe instead of
>
> > > echo $form->textarea('Article.contenu');
>
> > > use
>
> > > echo $form->input('Article.contenu', array(
> > >'type' => 'textarea'
> > > ));


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



  1   2   >