Re: Trouble with the translate function "__()"

2007-08-17 Thread Aaron Shafovaloff

Any ideas on this folks?

On Aug 17, 12:02 am, citrus <[EMAIL PROTECTED]> wrote:
> I have the same problem while trying to use __() in my validation
> message.


--~--~-~--~~~---~--~~
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: Siloing in cakephp?

2007-08-17 Thread Dr. Tarique Sani

On 8/18/07, Mech7 <[EMAIL PROTECTED]> wrote:
> domain/animals/birds/hummingbird/
>
> instead of
>
> domain/articles/view/hummingbird
>

Have done that with tags in cheesecake it was a bit more difficult as
tags is a HABTM relationship and the tags could potentially be in
random order eg: photos/2007/vacation/ or photos/vacation/2007

Since in your case the order will be fixed it is just a matter of
looping thru like - foreach ($this->params['pass'] as $category) and
getting the ID of the final category - then use it in your query.

Yes it will need a custom function in the model...

Cheers
T


-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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:

2007-08-17 Thread Samuel DeVore

Yea,
  I think of them as equivalent things in my mind, things to avoid in
my code.  I like to be as portable as possible.

Sam D

On 8/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I think what Samuel meant is short tags to true, not asp-tags. They
> are two completely different settings.
>
> short_open_tag = On
>
> Set this in your php.ini and you will be able to use short tags
>
>
> >
>


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

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

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

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



Re: can not view cake sceencasts with VLC

2007-08-17 Thread Chris Hartjes

On 8/17/07, walterbyrd <[EMAIL PROTECTED]> wrote:
>
> I am using debian sid. Everybody said to use VLC. So I tried that.
>
> Installed like this:
>
> aptitude install vlc libdvdcss2 w32codecs mozilla-plugin-vlc vlc-nox
> debian-multimedia-keyring
>
> Still won't play cake screencasts.

Dunno what to say.  I've used VLC on Linux (Ubuntu Feisty) and had no problems.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

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

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



can not view cake sceencasts with VLC

2007-08-17 Thread walterbyrd

I am using debian sid. Everybody said to use VLC. So I tried that.

Installed like this:

aptitude install vlc libdvdcss2 w32codecs mozilla-plugin-vlc vlc-nox
debian-multimedia-keyring

Still won't play cake screencasts.


--~--~-~--~~~---~--~~
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 Bake/PHP CLI problem..

2007-08-17 Thread Walker Hamilton

Heya,

Don't use that anymoreyou're using cakephp 1.2 (latest) do this:

../cake/console/cake bake

this command will work from the root of your app/ directory if
cake core is on the same level as your app dir.


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

2007-08-17 Thread [EMAIL PROTECTED]

I think what Samuel meant is short tags to true, not asp-tags. They
are two completely different settings.

short_open_tag = On

Set this in your php.ini and you will be able to use short tags


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

2007-08-17 Thread Mech7

Yeah so it's better not to use this to keep the code more portable :)

On Aug 17, 10:44 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> this only works on servers that have the asp-tags setting to true
>
> http://us.php.net/manual/en/ini.core.php#ini.asp-tags
>
> On 8/17/07, michael lucas <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm pretty sure this problem is related to some basic setting, but I
> > couldn't solve it myself.
>
> > A lot examples of valid cakephp templates code use this kind of php
> > openning tag:  > it's a lot more friendly. Unfortunately,  > (wamp). Has anybody got an idea how to get it running properly  ?
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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



Re: Acl question

2007-08-17 Thread Langdon Stevenson

Hi Nina

Glad I could be of some assistance :-)

Regards,
Langdon


Nina wrote:
> Hi Langdon
> 
> Your code sent me off in the right direction, so thank you for your
> help. However I had to make substantial changes, because you code did
> not fit with my user-model (and not with the functions avalible in
> cake 1.2). Allow me to explain (for general edification):



--~--~-~--~~~---~--~~
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 make a good use of Elements and DRY principe ?

2007-08-17 Thread gremlin

Somehow lost some of the post.

Also in views that dont have a $users variable set you can use the
element $this->renderElement( 'users_list' );
Using ajax to return html snippets would work as well. - jquery style
- $( '#element' ).load( Url/users/index ); would load the cached
element into the #element.

Remember you need to play with the RequestHandler component and either
extension parsing or request handling code to serve the ajax view in a
blank layout.

Again have fun with this stuff. Let us know what you come up with.


On Aug 17, 1:41 pm, gremlin <[EMAIL PROTECTED]> wrote:
> What you need to do is write an index action for your users_controller
> like you would if you were NOT using ajax or reusing that action at
> all.
> Once you have that done, modify that function to check isset( 
> $this->params['requested'] ) to see if the view action if being called via
>
> the requestAction function.
>
> ***
>
> function index( )
> $users = $this->User->findAll( );
> if( isset( $this->params['requested'] ) ){
> return $users;
> }
> $this->set( 'users', $users );
>
> }
>
> Then you create an element - users_list.ctp
>
> if( !isset( $_data ) ) {
>$_data = $this->requestAction( array( 'controller' => 'users',
> 'action' => 'index' ) );}
>
> 
> foreach( $_data as $row _) {
> echo use data}
>
> 
>
> You can then use the element in your users_controller index view file.
> $this->renderElement( 'users_list', array( '_data' => $users );
>
> For a good write up check out the bakery 
> articles..http://bakery.cakephp.org/articles/view/creating-reusable-elements-wi...http://bakery.cakephp.org/articles/view/cache-elements-individually-f...http://bakery.cakephp.org/articles/view/optimizing-your-cakephp-eleme...
>
> This will show you how to create these reusable elements as well as
> how to cache them based on the freshness of the model data, timestamps
> and on a per user / instance basis
>
> Enjoy.
>
> and in other view without the $users data $this->renderElement( 'users_list' 
> );
>
> On Aug 16, 2:42 pm, "Christophe C." <[EMAIL PROTECTED]> wrote:
>
> > up :(
> > Any suggestions ?


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

2007-08-17 Thread Samuel DeVore

this only works on servers that have the asp-tags setting to true

http://us.php.net/manual/en/ini.core.php#ini.asp-tags

On 8/17/07, michael lucas <[EMAIL PROTECTED]> wrote:
>
> I'm pretty sure this problem is related to some basic setting, but I
> couldn't solve it myself.
>
> A lot examples of valid cakephp templates code use this kind of php
> openning tag:  it's a lot more friendly. Unfortunately,  (wamp). Has anybody got an idea how to get it running properly  ?
>
>
> >
>


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

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

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

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



Re: How to make a good use of Elements and DRY principe ?

2007-08-17 Thread gremlin

What you need to do is write an index action for your users_controller
like you would if you were NOT using ajax or reusing that action at
all.
Once you have that done, modify that function to check isset( $this-
>params['requested'] ) to see if the view action if being called via
the requestAction function.

***

function index( )
$users = $this->User->findAll( );
if( isset( $this->params['requested'] ) ){
return $users;
}
$this->set( 'users', $users );
}

Then you create an element - users_list.ctp

if( !isset( $_data ) ) {
   $_data = $this->requestAction( array( 'controller' => 'users',
'action' => 'index' ) );
}

foreach( $_data as $row _) {
echo use data
}


You can then use the element in your users_controller index view file.
$this->renderElement( 'users_list', array( '_data' => $users );

For a good write up check out the bakery articles..
http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction
http://bakery.cakephp.org/articles/view/cache-elements-individually-for-each-user
http://bakery.cakephp.org/articles/view/optimizing-your-cakephp-elements-and-views-with-caching

This will show you how to create these reusable elements as well as
how to cache them based on the freshness of the model data, timestamps
and on a per user / instance basis

Enjoy.


and in other view without the $users data $this-
>renderElement( 'users_list' );
On Aug 16, 2:42 pm, "Christophe C." <[EMAIL PROTECTED]> wrote:
> up :(
> Any suggestions ?


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

2007-08-17 Thread [EMAIL PROTECTED]

Thanks . I will try it !!!

On Aug 17, 9:54 pm, "Luiz Paulo Nascimento"
<[EMAIL PROTECTED]> wrote:
> Try this component:
>
> http://www.reversefolds.com/articles/show/filehandler
>
> LP
>
> 2007/8/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
>
>
>
>
> > I want to copy a file on my server. Here is my code.
>
> > My input file button :
> > ...
> > file('Language/image');   ?>
> > 
>
> > this make a following html code :
> > ...
> > 
> > ...
>
> > Controller:
>
> > $fileData = $this->data['Language']['image'];
>
> > copy($_FILES[$fileData]['tmp_name'], $folder.$fileName);
>
> > if i'm not wrong to copy the file i should do something like this:
>
> > copy($_FILES[' data[Language][image]' ]['tmp_name'], $folder.
> > $fileName);
> > but i'm getting alway a error:  Notice: Undefined index: DSC00766.JPG -
> > > this is a file that i upload.
>
> > data[Language][obrazek] - this is the name of my input file form. Is
> > this a array?
>
> > How  to get a name of the input button ? I mean this : "data[Language]
> > [obrazek]"
> > I want to use it in my $_FILES array
>
> > Please help me. Does anyone know how to do this?
>
> > Stan
>
> --
> Luiz Paulo Nascimento
> [EMAIL PROTECTED]


--~--~-~--~~~---~--~~
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-php@googlegroups.com

2007-08-17 Thread michael lucas

I'm pretty sure this problem is related to some basic setting, but I
couldn't solve it myself.

A lot examples of valid cakephp templates code use this kind of php
openning tag: http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Siloing in cakephp?

2007-08-17 Thread gremlin

I have had good success by using a model function to generate a custom
query from the url. Search for other posts on nested categories for
some solutions. I generally resolve the id of the article/category -
whatever is nested - using a recursive function in the model and then
pass that along to a regular find call.

On Aug 17, 12:46 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/17/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yes it is, but how to do it without knowing how deep it goes.. it
> > could be..
>
> > /animals
> > /animals/birds/
> > /animals/birds/hummingbird
>
> That is the trick, isn't it. :)
>
> Part of the problem is that you are trying to do pattern matching on a
> potentially open-ended pattern, right?
>
> You might have to break down into routes like
>
> /animals/birds/, and that sort of thing you can easily
> create a route for.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Re: Cake Bake/PHP CLI problem..

2007-08-17 Thread [EMAIL PROTECTED]

Whoops, forgot the ".php".

Carry on. :)

On Aug 17, 12:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I'm using PHP5 and Cakephp 1.2 (latest) on OS X. When I issue the
> command "php cake bake", I get the following output:
>
> ### 
> #
> #
> # Bake is a shell script for running CakePHP bake script
> # PHP versions 4 and 5
> #
> # ... Licensing info removed for brevity...
> #
> ### 
> #
> clear
>
> LIB=${0/%cake/}
> APP=`pwd`/
>
> echo "Hello $USER,"
>
> exec php -q ${LIB}cake.php "$@" -working "${APP}"
>
> echo " ";
>
> exit;
>
> ---
>
> Where is the problem? PHP config, CakePHP config, something else?
>
> Thanks in advance!


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



Re: Problem - sending

2007-08-17 Thread Luiz Paulo Nascimento

Try this component:

http://www.reversefolds.com/articles/show/filehandler

LP

2007/8/17, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> I want to copy a file on my server. Here is my code.
>
> My input file button :
> ...
> file('Language/image');   ?>
> 
>
> this make a following html code :
> ...
> 
> ...
>
> Controller:
>
> $fileData = $this->data['Language']['image'];
>
> copy($_FILES[$fileData]['tmp_name'], $folder.$fileName);
>
> if i'm not wrong to copy the file i should do something like this:
>
> copy($_FILES[' data[Language][image]' ]['tmp_name'], $folder.
> $fileName);
> but i'm getting alway a error:  Notice: Undefined index: DSC00766.JPG -
> > this is a file that i upload.
>
> data[Language][obrazek] - this is the name of my input file form. Is
> this a array?
>
> How  to get a name of the input button ? I mean this : "data[Language]
> [obrazek]"
> I want to use it in my $_FILES array
>
>
> Please help me. Does anyone know how to do this?
>
> Stan
>
>
> >
>


-- 
Luiz Paulo Nascimento
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 Bake/PHP CLI problem..

2007-08-17 Thread [EMAIL PROTECTED]

I'm using PHP5 and Cakephp 1.2 (latest) on OS X. When I issue the
command "php cake bake", I get the following output:


#
# Bake is a shell script for running CakePHP bake script
# PHP versions 4 and 5
#
# ... Licensing info removed for brevity...
#

clear

LIB=${0/%cake/}
APP=`pwd`/

echo "Hello $USER,"

exec php -q ${LIB}cake.php "$@" -working "${APP}"

echo " ";

exit;

---

Where is the problem? PHP config, CakePHP config, something else?

Thanks in advance!


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



Re: display form results to new layout - no database

2007-08-17 Thread Chris Hartjes

On 8/17/07, bobble-gobble <[EMAIL PROTECTED]> wrote:
>
> I'm new to Cake and have been searching for this answer for the last
> couple days.  Can't seem to find anything -- although I'm sure the
> problem is easily solved.
>
> Here's the situation:
>
> I have a form with validation working perfectly.  No database is being
> used.  After validation, I want to display the results of the form on
> a "printable page" (so very minimal layout).  How do you pass form
> results to a new layout?  What are the methods I should be looking at?
>
> Your help is very much appreciated.

I would do it the following way, but your milleage may vary.

1) have your form point to an action that is different from the one
that displays the form
2) all the data you've submitted is in $this->data, so all you have to
do is use $this->set(...) to populate variables in the "printable
page"

Hope that helps.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

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

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



Re: Siloing in cakephp?

2007-08-17 Thread Chris Hartjes

On 8/17/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> Yes it is, but how to do it without knowing how deep it goes.. it
> could be..
>
> /animals
> /animals/birds/
> /animals/birds/hummingbird

That is the trick, isn't it. :)

Part of the problem is that you are trying to do pattern matching on a
potentially open-ended pattern, right?

You might have to break down into routes like

/animals/birds/, and that sort of thing you can easily
create a route for.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

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

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



Re: Siloing in cakephp?

2007-08-17 Thread Mech7

Yes it is, but how to do it without knowing how deep it goes.. it
could be..

/animals
/animals/birds/
/animals/birds/hummingbird



On Aug 17, 9:00 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/17/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
>
>
> > Is there any article about using siloing in url's for cakephp.. by
> > siloing i mean, creating the tree structure in the url for nested
> > categories for example...
>
> > domain/animals/birds/hummingbird/
>
> > instead of
>
> > domain/articles/view/hummingbird
>
> Isn't that just custom routing?
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboarYesd -http://www.littlehart.net/atthekeyboard


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



display form results to new layout - no database

2007-08-17 Thread bobble-gobble

I'm new to Cake and have been searching for this answer for the last
couple days.  Can't seem to find anything -- although I'm sure the
problem is easily solved.

Here's the situation:

I have a form with validation working perfectly.  No database is being
used.  After validation, I want to display the results of the form on
a "printable page" (so very minimal layout).  How do you pass form
results to a new layout?  What are the methods I should be looking at?

Your help is very much appreciated.

Thank,
B


--~--~-~--~~~---~--~~
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: Increasing list views in baked app

2007-08-17 Thread Beertigger


D'oh!

Right there at the top of the controller...

Must.get.more.sleep.


Beertigger


On Aug 17, 8:37 am, Beertigger <[EMAIL PROTECTED]> wrote:
> How do I get more items to display in a list view in a baked app? I
> need to extend the list from the default of 10
>
> Thanks!
>
> Beertigger


--~--~-~--~~~---~--~~
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: Siloing in cakephp?

2007-08-17 Thread Chris Hartjes

On 8/17/07, Mech7 <[EMAIL PROTECTED]> wrote:
>
> Is there any article about using siloing in url's for cakephp.. by
> siloing i mean, creating the tree structure in the url for nested
> categories for example...
>
> domain/animals/birds/hummingbird/
>
> instead of
>
> domain/articles/view/hummingbird
>

Isn't that just custom routing?

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

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

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



Siloing in cakephp?

2007-08-17 Thread Mech7

Is there any article about using siloing in url's for cakephp.. by
siloing i mean, creating the tree structure in the url for nested
categories for example...

domain/animals/birds/hummingbird/

instead of

domain/articles/view/hummingbird


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



Problem - sending

2007-08-17 Thread [EMAIL PROTECTED]

I want to copy a file on my server. Here is my code.

My input file button :
...
file('Language/image');   ?>


this make a following html code :
...

...

Controller:

$fileData = $this->data['Language']['image'];

copy($_FILES[$fileData]['tmp_name'], $folder.$fileName);

if i'm not wrong to copy the file i should do something like this:

copy($_FILES[' data[Language][image]' ]['tmp_name'], $folder.
$fileName);
but i'm getting alway a error:  Notice: Undefined index: DSC00766.JPG -
> this is a file that i upload.

data[Language][obrazek] - this is the name of my input file form. Is
this a array?

How  to get a name of the input button ? I mean this : "data[Language]
[obrazek]"
I want to use it in my $_FILES array


Please help me. Does anyone know how to do this?

Stan


--~--~-~--~~~---~--~~
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: HABTM Does not select extra table :(

2007-08-17 Thread Mech7

Thanks but i am not really sure what you mean by query the menu
model ?

On Aug 16, 1:39 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> You cannot query across a HABTM like that - the relationships are
> generated through multiple SQL queries so your WHERE does not get put
> in the right part (and the WHERE is just whatever conditions you
> provide - Cake does not understand what you want).
>
> Instead, query the Menu model, with appropriate recursive set (and
> bindModel / unbindModel if needed) to get the associated Articles that
> you want.
>
> On Aug 16, 3:17 am, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > Nobody :(
>
> > On Aug 12, 4:51 pm, Mech7 <[EMAIL PROTECTED]> wrote:
>
> > > Anybody has an idea ? :(


--~--~-~--~~~---~--~~
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 write codes in Vendor to save time?

2007-08-17 Thread citrus

vendor directory is used for third-party app that you want to
integrate with your Cake app.

in this case, you can use Cake's built-in function wrapper: pr();
which does the same thing as you want.

check out basics.php for more stuff like that: a(), aa(), up(), etc.

happy baking!

On Aug 17, 11:56 pm, Steveston <[EMAIL PROTECTED]> wrote:
> Very frequently, I need to use codes like this to see output clearly:
>
> $a=print_r($var,true);
> echo "$a";
>
> How can convert this piece of code to a program in Vendor so that I
> can reuse it?
>
> Thanks,


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



How to write codes in Vendor to save time?

2007-08-17 Thread Steveston

Very frequently, I need to use codes like this to see output clearly:

$a=print_r($var,true);
echo "$a";

How can convert this piece of code to a program in Vendor so that I
can reuse it?

Thanks,


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



Re: $html->checkboxTag

2007-08-17 Thread Max

There's an error with your PHP code
checkboxTag("customer/
f_name",'',array("id"=>"f_name","onclick"=>"enableField()")); ?>

Above should work...

Here's the syntax: checkboxTag ($fieldName, $title=null,
$htmlAttributes=null, $return=false)

On Aug 17, 7:33 pm, Unite <[EMAIL PROTECTED]> wrote:
> 
> function enableField() {
> alert("hello");}
>
> 
>
> checkboxTag("customer/
> f_name",array("id"=>"f_name","onclick"=>"enableField()")); ?>
>
> This onclick isnt even calling the javascript function. plz 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
-~--~~~~--~~--~--~---



Re: Lots of disk activity, caching gone mad?

2007-08-17 Thread [EMAIL PROTECTED]

Sorry Luke I did read your message. My posts seem to take a while to
appear so there is a bit of a time delay.

> define("DISABLE_CACHE", true);

I tried this. As soon as I added it to core.php my disk writing
rocketed up to 140MBps and the top half a dozen httpd processes were
using around 30% processor and 300MB of RAM each. I quickly switched
the cache back on.

My latest thinking is that I have a page or section that is coded so
that it is cached but shouldn't be and every visitor that comes to the
site is writing their version of the page over the cached one.

'All' I need to do is find it :-(

Paul


--~--~-~--~~~---~--~~
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: Acl question

2007-08-17 Thread Nina

Duh... I posted to soon, this is the function:

  function _getAllowedIds ($model, $access_type) {
//this function returns a comma delimited string of id's that the
logged in user has access to in the model given.
$aro = new Aro();

// Get the username.  It may be better to pass this to the
function
$user = $this->Session->read('User');
$aroAlias = 'User::'.$user['id'];
$aroNode = $this->Acl->Aro->node($aroAlias);
$permission = new Permission();

//loop from branches of aro tree to top
for ($i = 0; $i < count($aroNode) -1; $i++) {
  $temp[] = $permission->findAllByAro_id($aroNode[$i]['Aro']
['id']);
}

$Aco = new Aco();
$acos = array();
// Iterate through the links. The temp array (containing
// permission entries) is sorted by aro, and leaves comes before
// their parrents

foreach ($temp as $tempAro) {
  // Iterate through each Aco attached the the current Aro
  foreach ($tempAro as $tempLink) {
if (preg_match ("/^".$model."::\d+$/", $tempLink['Aco']['alias']))
{
  //the following contruction assures that permissions are
  //taken from the bottoms-most aro in the aro tree. I.e. if a
  //user belongs to a group, the group has access to a file
  //but the user does not, the user should not have
  //access. First time we arrive here, the permission for a
  //given aco is set to whatever it is for the bottom-most
  //aro. Second time we arrive the permission is only changed
  //if permission has not been specified in the first place.
  if (array_key_exists($tempLink['Aco']['alias'], $acos)) {
switch($acos[$tempLink['Aco']['alias']]) {
case -1:
  $acos[$tempLink['Aco']['alias']] = -1;
  break;
case 0:
  $acos[$tempLink['Aco']['alias']] = $tempLink['Permission']['_'.
$access_type];
  break;
case 1:
  $acos[$tempLink['Aco']['alias']] = 1;
  break;
}
  } else {
$acos[$tempLink['Aco']['alias']] = $tempLink['Permission']['_'.
$access_type];
  }
}
  }
  // the acl model in this application is contructed such that
Picture::id (or Text::id etc.) acos do not have children.
  // this means that there is no reason to find children on the
acos in this loop
}

//extract the id's
$acos_out = array();
foreach ($acos as $key => $aco) {
  if ($aco == 1) {
array_push($acos_out,preg_replace("/^".$model."::(\d+)/", "$1",
$key));
  }
}

//create a comma delimited string of id's
$string = implode(",", $acos_out);
return $string;
  }


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



Increasing list views in baked app

2007-08-17 Thread Beertigger


How do I get more items to display in a list view in a baked app? I
need to extend the list from the default of 10

Thanks!

Beertigger


--~--~-~--~~~---~--~~
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: Acl question

2007-08-17 Thread Nina

Hi Langdon

Your code sent me off in the right direction, so thank you for your
help. However I had to make substantial changes, because you code did
not fit with my user-model (and not with the functions avalible in
cake 1.2). Allow me to explain (for general edification):

I have a user model where users can belong to a group. Aros for groups
are name Group::$group_id and Aros for users are named User::$user_id.
Groups and users are two seperate tables in my database. In my aros
tree, a user aro always have a group aro as parrent.

My acos are named after the model they correspond to. For example the
aco named Picture::1 represents operations on picture number 1. By
allowing or denying actions on this aco, I allow a user (or group) the
right to perform those actions.

When I check which Aros a certain user is represented by, I will
always get at least two: the user aro and the group aro (plus the
parent group aro, if there is one). When I allow and deny a certain
aco the user aro, or lowermost aro in the aro tree, is the one that
counts. Thus, if a group has read permission and the user has not, the
user should be denied access. Thus, we must check the aros-acos
permissions in a specific order. This is the function I cam up with.
It works because the node() function in acl always returns the tree in
the proper order:

  function _getAllowedIds ($model, $access_type) {
//this function returns a comma delimited string of id's that the
logged in user has access to in the model given.
$aro = new Aro();

// Get the username.  It may be better to pass this to the
function
$user = $this->Session->read('User');
$aroAlias = 'User::'.$user['id'];
$aroNode = $this->Acl->Aro->node($aroAlias);
$permission = new Permission();

//loop from branches of aro tree to top
for ($i = 0; $i < count($aroNode) -1; $i++) {
  $temp[] = $permission->findAllByAro_id($aroNode[$i]['Aro']
['id']);
}

$Aco = new Aco();
$acos = array();
// Iterate through the links. The temp array (containing
// permission entries) is sorted by aro, and leaves come before
// their parrents

foreach ($temp as $tempAro) {
  // Iterate through each Aco attached the the current Aro
  foreach ($tempAro as $tempLink) {
if (preg_match ("/^".$model."::\d+$/", $tempLink['Aco']['alias']))
{
  //the following construction assures that permissions are
  //taken from the bottoms-most aro in the aro tree. I.e. if a
  //user belongs to a group, the group has access to a file
  //but the user does not, the user should not have
  //access. First time we arrive here, the permission for a
  //given aco is set to whatever it is for the bottom-most
  //aro. Second time we arrive the permission is only changed
  //if permission has not been specified in the first place.
  if (array_key_exists($tempLink['Aco']['alias'], $acos)) {
switch($acos[$tempLink['Aco']['alias']]) {
case -1:
  $acos[$tempLink['Aco']['alias']] = -1;
  break;
case 0:
  $acos[$tempLink['Aco']['alias']] = $tempLink['Permission']['_'.
$access_type];
  break;
case 1:
  $acos[$tempLink['Aco']['alias']] = 1;
  break;
}
  } else {
$acos[$tempLink['Aco']['alias']] = $tempLink['Permission']['_'.
$access_type];
  }
}
  }
  // the acl model in this application is contructed such that
Picture::id (or Text::id etc.) acos do not have children.
  // this means that there is no reason to find children on the
acos in this loop
}

//extract the id's
foreach ($acos as $key => $aco) {
  if ($aco == 1) {
$acos[$key] = preg_replace("/^".$model."::(\d+)/", "$1", $aco);
  } else {
unset($acos[$key]);
  }
}

//create a comma delimited string of id's
$string = implode(",", $acos);
return $string;
  }
}

When calling this function I get a string of id's which corrensponds
to the table entries that a user has x-access to (where x is create,
read, update or delete).

I hope someone might find this useful.

:-)

Nina

On Aug 16, 1:07 pm, Langdon Stevenson <[EMAIL PROTECTED]>
wrote:
> Hi Nina
>
> 
>
> > However, what I'd like is a simple command to find all pictures that a
> > given user has access to. I realize that I can find all pictures and
> > check them one by one. However, this seems expensive to me (one query
> > to get all pictures and then N queries to check the permissions).
> > There must be a simpler way to do it, but to find it requires a deep
> > understanding of howaclwork, and I don't really have that
> > understanding (yet), so I am asking you. Has anyone here encountered a
> > similar problem, and how did you solve it? If not, do you have any
> > ideas on how I might attack this problem?
>
> If you have a look at the api forACLyou w

Re: $html->checkboxTag

2007-08-17 Thread Unite


function enableField() {
alert("hello");
}


checkboxTag("customer/
f_name",array("id"=>"f_name","onclick"=>"enableField()")); ?>

This onclick isnt even calling the javascript function. plz 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
-~--~~~~--~~--~--~---



Re: $html->checkboxTag

2007-08-17 Thread Unite

Just a bit of further information after testing looks like
"onclick"=>"enableField()" doesnt call enableField so onclick isnt
working :(


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



$html->checkboxTag

2007-08-17 Thread Unite

Hi.
What I basically want is to when a checkbox is ticked a input field
becomes enabled. Its working if i use a button onclick routine but has
no effect when i onclick the checkbox.

Any help greatly appreciated.



function enableField() {

if (document.forms['customer'].f_name.checked=true)
document.forms['customer'].f_name_rename.disabled=false;
   if (document.forms['customer'].f_name.checked=false)
document.forms['customer'].f_name_rename.disabled=true;

}


formTag('/invoicetemps/
setup/','post',array('name'=>'customer', 'id'=>'customer'));?>
checkboxTag("customer/
f_name",array("id"=>"f_name","onclick"=>"enableField()")); ?>
input("customer/f_name_rename",array("value"=>"First
Names","disabled"=>"disabled","id"=>"f_name_rename")); ?>


--~--~-~--~~~---~--~~
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: setting the base url for url language support

2007-08-17 Thread Chowsapal

Not sure if this is the best way, but ff you're using Cake 1.2, you
could setup routes to map /:language/:controller/:action.  Then, you
could either (1) override the helpers you need to automatically
include the language (either from the session, if you keep it there,
or from $params) or (2) manually add the language parameter to each
link (using 
http://api.cakephp.org/1.2/class_helper.html#e2b93ee7f11ae5936be62ccf8b3ce405).
For example, $html->link('Login', array('controller' => 'accounts',
'action' => 'login', 'language' => $params['language']).  HTH.

On Aug 17, 8:43 am, Charlie <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I searched but didn't found my answer on this topic:
> I want to use the language ISO code on my url like:www.example.com/en/
> orwww.example.com/nl/
> This is working fine when I manual add these codes in the url and I
> completed also a check in the beforeFilter() if a language was
> provided in the url.
>
> But know I like it to work with $html->link() and $form->create()
> functions without checking on the language and add it in all my links
> and template code.
> Is there a var where you can set a base url that is supported by the
> form and html helpers?
>
> If not, someone else a good idea about this?
> thnx!


--~--~-~--~~~---~--~~
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 put independent functions

2007-08-17 Thread David Cole

>From my understanding, independent functions should go into their respective
model file. That way you can call the function from the controller like
$this->Model->func(). Right?

Dave

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of luke BAKING barker
Sent: Friday, August 17, 2007 4:12 AM
To: Cake PHP
Subject: Re: where to put independent functions


why not jsut create an empty model? I was sure there was something
also in the controller you could put like $uses = null or

On Aug 16, 2:42 pm, rtanz <[EMAIL PROTECTED]> wrote:
> yep i understood perfectly, managed to implement it thanks




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



A problem with paths

2007-08-17 Thread ifcanduela

Hello there,

I have developed a fairly simple application, and it works
flawlessly... on my local server. When it has come the time to upload
the files to the client's host, only the 'home' page is displayed,
without CSS styling, and the links lead to 404s. When I try to reach
another model/action page, the same error (404) appears. There's no
option to enable mod_rewrite in the server or modify their htaccess
files, so I've enabled Cake's own routing, and I guess this is giving
problems. The thing is, in my local server, it al works, wit
mod_rewrite or without. Could it be that I haven't FTP'd a hidden file
or something?

The app is hosted at http://www.escaparatetactil.es/demoav/ and I've
setup a phpinfo() script (http://www.escaparatetactil.es/demoav/
phpinfo.php) for anyone to check. Although I've discarded a problem
with Apache or MySQL, I'm no expert whatsoever, so all options are
plausible.

Thanks a lot for any help.
-Igor F. Canduela


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



setting the base url for url language support

2007-08-17 Thread Charlie

Hi,

I searched but didn't found my answer on this topic:
I want to use the language ISO code on my url like: www.example.com/en/
or www.example.com/nl/
This is working fine when I manual add these codes in the url and I
completed also a check in the beforeFilter() if a language was
provided in the url.

But know I like it to work with $html->link() and $form->create()
functions without checking on the language and add it in all my links
and template code.
Is there a var where you can set a base url that is supported by the
form and html helpers?

If not, someone else a good idea about this?
thnx!


--~--~-~--~~~---~--~~
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: Lots of disk activity, caching gone mad?

2007-08-17 Thread luke BAKING barker

did you read what I wrote?

NAte in another post on this group: "Hi zipman, there's an
undocumented "feature" that allows you to
completely disable Cake's caching by adding this:

define("DISABLE_CACHE", true);

to app/config/core.php.  However, this is only recommended in the most
extreme unusual cases, as your application will take quite a
performance hit for having to query the database for table
descriptions
on every request.

However, it doesn't sound like table caching is your issue.  It sounds
more like an HTTP or browser cache thing.  Cake 1.2 has a new
controller method called disableCache() which will send the
appropriate
headers so that the browser does not cache your page. "

On Aug 17, 10:45 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> > Maybe excessive logging with $this->log()?
>
> As far as I can see we aren't using any logging function. As I
> mentioned, disk space isn't being eaten up so it must be temp files of
> some sort
>
> > Or is the kernel swapping to/from disk?
>
> There is plenty of RAM on this Mac (and plenty spare)
> top says...
>
> PhysMem:   489M wired,  521M active,  801M inactive, 1.77G used, 2.24G
> free
> VM: 7.71G + 86.6M   85885(3) pageins, 0(0) pageouts
>
> > Take a look at the fs_usage(1) tool,
>
> fs_usage tells me there are two tasks writing to disk, httpd and
> cronolog (the Apache server logs are piped to it). I turned off Apache
> logging and it made no discernible difference to the amount of data
> being written.
>
> I stopped the Apache server and all the disk activity stopped.
>
> So referring to my original question, does setting
> define('CACHE_CHECK', true); to define('CACHE_CHECK',false); actually
> stop cake writing cache files or only stop it from serving cached
> pages (this is what the comments in core.php seem to suggest to me).
>
> Is there a way to stop all cache writing?
>
> In some of the controllers the developer (sorry I didn't write it all
> just trying to fix it) has put..
> $this->cacheAction = '';
> Is it correct that this stops it being cached?
>
> Paul


--~--~-~--~~~---~--~~
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: Lots of disk activity, caching gone mad?

2007-08-17 Thread [EMAIL PROTECTED]

> Maybe excessive logging with $this->log()?

As far as I can see we aren't using any logging function. As I
mentioned, disk space isn't being eaten up so it must be temp files of
some sort

> Or is the kernel swapping to/from disk?

There is plenty of RAM on this Mac (and plenty spare)
top says...

PhysMem:   489M wired,  521M active,  801M inactive, 1.77G used, 2.24G
free
VM: 7.71G + 86.6M   85885(3) pageins, 0(0) pageouts

> Take a look at the fs_usage(1) tool,

fs_usage tells me there are two tasks writing to disk, httpd and
cronolog (the Apache server logs are piped to it). I turned off Apache
logging and it made no discernible difference to the amount of data
being written.

I stopped the Apache server and all the disk activity stopped.

So referring to my original question, does setting
define('CACHE_CHECK', true); to define('CACHE_CHECK',false); actually
stop cake writing cache files or only stop it from serving cached
pages (this is what the comments in core.php seem to suggest to me).

Is there a way to stop all cache writing?

In some of the controllers the developer (sorry I didn't write it all
just trying to fix it) has put..
$this->cacheAction = '';
Is it correct that this stops it being cached?

Paul


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

2007-08-17 Thread rtanz

nevermind, ctp seems to be for 1.2, so for anyone using 1.1 like me u
have to use .thtml.

regarding second problem, i had overriden the beforeFilter that's why
the one in the AppController wasnt working. solution is to include
parent::beforeFilter


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



Re: find articles of active users<-authors (bind model)

2007-08-17 Thread jyrgen

the User model is not directly associated to Articles, but
via the Author model.

Articles have a foreign "author_id", same does the User model.

When i add an association in the Article model between User and
Article like this:
(i could do this on the fly with bind model also)

'User' =>
array('className' => 'User',
'foreignKey' => 'author_id',
'conditions' => '',
'fields' => '',
'order' => '',
'counterCache' => ''
),

i get this join condition:

`Article`.`author_id` = `User`.`id`

which leads to empty results. The field "id" is automatically used by
cake.

It should read:

`Article`.`author_id` = `User`.`author_id`











which doesn'T


--~--~-~--~~~---~--~~
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: find articles of active users<-authors (bind model)

2007-08-17 Thread jyrgen

here's the crucial part of the sql generated:

...
FROM `articles` AS `Article`
LEFT JOIN `authors` AS `Author` ON `Article`.`author_id` =
`Author`.`id`
LEFT JOIN `users` AS `somestring` ON `Article`.`user_id` =
`somestring`.`id`
...


the problem is that `Article`.`user_id` doesn't exist..





--~--~-~--~~~---~--~~
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: find articles of active users<-authors (bind model)

2007-08-17 Thread jyrgen

to put it in other words :

i try to find model values of a "deep" or "remote" association.

Article -> Author -> User

While it's easy to find articles with

Author.name LIKE %bla%

i don't know how to test for values in the User model, because
the Author model sits *in between* Article and User...

Obviously the User model is not present.

jyrgen



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



find articles of active users<-authors (bind model)

2007-08-17 Thread jyrgen

In my article search three models are involved:

Article -> belongsTo Author
Author -> hasMany Articles

Author -> hasOne User
User -> belongsTo Author

the User model separates web account data from the personal author
information, it holds login/password, as well as a flag telling if a
User is active ('Y').

I'd like to retrieve all Articles matching certain criteria
like $conditions['Article']['topic'] = "blabla"; and so on, this works
fine.

But i'm not able to restrict the results to *only active* Users<-
Authors.

this is the code i tried in the article search action

$bindArray = array();
$bindArray['belongsTo']['somestring'] = array('className'=>'User');
$this->Article->bindModel($bindArray);
$conditions['somestring.active'] = "= 'Y'";

(ERROR: Unknown column 'Article.user_id' in 'on clause')

Also $this->Article->Author->bindModel($bindArray); doesn't work

(ERROR: Unknown column 'somestring.active' in 'where clause')


this is the find statement

$this->Article->recursive = 1;
$sortby = array("Article.created" => "DESC");
$article_list = $this->Article->findAll($conditions, null, $sortby);


I know i can get this running, but i'm stuck here.

Do i have to bind the User model at all ? (since it *is* already
associated->associated
via Author...)

thanks a lot,

jyrgen


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



Re: How can I updated table using checkboxes and button

2007-08-17 Thread nirmal

please tell me how can i send checkbox values from template to
controller.
template: (its related to site model)
hidden('Site/id', array('value' => $site['Site']
['id']));?>
(from this line i am geeting site id)

 hidden('Campaign/id', array('value' =>$campaign[]
[]));?>
(from this line i want to get campaign id, but i am not able to get it
because it is related to campaign model)

submit('Deny All') ?>

thank you,

--
Nirmal

On Aug 16, 9:27 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 8/16/07, bbuchs <[EMAIL PROTECTED]> wrote:
>
>
>
> > Jerk.
>
> Well, there are three potential "jerks"
>
> 1) the original poster for expecting people to simply provide them with code
> 2) the responder who told them to go read the manual
> 3) the person who called the responder in #2 a "jerk"
>
> Personally, I would've responded:
>
> "Sounds like you need to use some Ajax functionality toupdateall checkboxes."
>
> However, when the request sounds like "please write some code for me
> because I need it for work / school and don't want to do it myself" I
> understand why people get annoyed.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


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



Re: admin section protection

2007-08-17 Thread francky06l

You can check in ACL, there are plenty of articles for using ACL with
controller-action access. Check in the Frequent Discussion in the
Pages section.

On Aug 17, 10:53 am, rtanz <[EMAIL PROTECTED]> wrote:
> hi i am using the tutorial for simple user authentication for general
> login to my site, now i am also using cake's admin routing for the
> admin part of the site, and i would like to make an additional check
> so that only the administrator can go into that part, any advice how
> to achieve this? I was thinking of adding a user level field when
> creating a new user, then storing that in the session on login, and
> finally checking for user level if there is an attempt to access an
> admin function. does this sound like a good method? thanks


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



Re: where to put independent functions

2007-08-17 Thread luke BAKING barker

why not jsut create an empty model? I was sure there was something
also in the controller you could put like $uses = null or

On Aug 16, 2:42 pm, rtanz <[EMAIL PROTECTED]> wrote:
> yep i understood perfectly, managed to implement it thanks


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



Re: css menu helper

2007-08-17 Thread rtanz

bdw do i need to add something to the admin actions themselves? coz
right now this is not working when i just put that in the
AppController class. thanks


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



Re: Best Practices - "Modular Blocks & Actions"

2007-08-17 Thread dft

hi Alan,
That's true. I'll look into using requestAction to preload, and then
try out the caching. Thanks for the link, looking at it right away.

Thanks
Femi TAIWO

On Aug 16, 3:13 pm, alan <[EMAIL PROTECTED]> wrote:
> You might consider initially loading all of your content serverside
> instead of AJAX.  Just put all the components together on one page
> using $this->requestAction() to get all the content elements.  You can
> then update and move them around with AJAX as your planning... but
> you'll see better performance if you preload the content.
>
> Also - you are really going to need to cache your data... I would
> cache each of the requestAction calls individually.
>
> http://bakery.cakephp.org/articles/view/ecache-easy-per-user-or-per-a...
>
> thanks,
> -alan-
>
> On Aug 15, 6:54 am, Femi Taiwo <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I need to includemultiplecontrollers& views on a single page. Yes this 
> > sounded easy at first, especially after I readCreating Reusable Elements 
> > with requestAction
> > until i found the possible overheads.
> > This is what I'm trying to do:
> > Build an application that allows the administrator to add order and move 
> > modules around on different parts of the application
> > I have a couple of models for this. One is PortalTab, second is 
> > PortalModule and the third that ties these two is PortalTabsPortalModule
> > a new module is registered into the portal by creating an entry for it in 
> > the portal_modules table. To make the module available for use, I put it in 
> > an existing
> > portal_tab record( as in i insert portal_tab_id and the portal_module_id 
> > into the portal_tabs_portal_module table) . By visiting the tab using a 
> > controller action e.g /tabs/viewtab/13, tab with id of 13 has many modules 
> > attached to it, and displays them accordingly. A lot of thot has also gone 
> > into what part of the page which module shows and their order.(1)I have 
> > viewtab.ctp which has a loop that runs through the $modulesToLoad (e.g) 
> > variable and loads each one via AJAX .
> > While this works quite well, the bad side to that the number of initial 
> > calls made to the server while it's loading via ajax:
> > number of calls =the total number modules. I forsee having on the average 
> > 4/5 modules per tab group. Some may be just two.
> > The project is growing quite fast especially with this mode of adding and 
> > working with modules dynamically, allowing the portal to have a loosely 
> > defined structure.I've also be able to effect calls using ajax and updating 
> > another block on the page.
> > Apart from the overhead, what other possible failings does this method 
> > have? Otherwise, what do I do instead?
> > Thanks!
> > Femi TAIWO.


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

2007-08-17 Thread rtanz

thanks, is the .ctp for 1.1 or 1.2?


--~--~-~--~~~---~--~~
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: Lots of disk activity, caching gone mad?

2007-08-17 Thread luke BAKING barker

there is another flag (see basics.php) which is called DISABLE_CACHE,
that might help?

On Aug 16, 7:02 pm, Marcus <[EMAIL PROTECTED]> wrote:
> Maybe excessive logging with $this->log()?
>
> Or is the kernel swapping to/from disk?
>
> Take a look at the fs_usage(1) tool, it's used to monitor the file
> system's activity - so you can identify the process which is causing
> the heavy I/O.
>
> Marcus
>
> On Aug 16, 6:27 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Any other ideas as to where to look?


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



admin section protection

2007-08-17 Thread rtanz

hi i am using the tutorial for simple user authentication for general
login to my site, now i am also using cake's admin routing for the
admin part of the site, and i would like to make an additional check
so that only the administrator can go into that part, any advice how
to achieve this? I was thinking of adding a user level field when
creating a new user, then storing that in the session on login, and
finally checking for user level if there is an attempt to access an
admin function. does this sound like a good method? thanks


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



hasMany optimizations

2007-08-17 Thread Kusok

Does anyone know how to optimize a hasMany query. For me it always
does at query like
select ... from TABLE where id in(NUMBER) for every item in the parent
table. How do I tell it to just select everything with 1 query?


--~--~-~--~~~---~--~~
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: Many to Many relations - How to?

2007-08-17 Thread luke BAKING barker

Andrea, there is also the 'with' parameter in 1.2: worth searching for
also, essentially does similar stuff. Not sure which is more 1.2 "way"
of doing things.

Luke

On Aug 17, 8:29 am, Andrea <[EMAIL PROTECTED]> wrote:
> Thanks to everybody! I've try it and I'm able to implements what I
> wants...
>
> Thanks!
>
> Bye Andrea
>
> On 17 Ago, 09:07, Andrea <[EMAIL PROTECTED]> wrote:
>
> > Thanks to everybody I try this thing that suggests Nate in this 
> > posthttp://groups.google.com/group/cake-php/browse_thread/thread/bef70558...
>
> > Chris, I am so glad you asked, because this is why Cake Owns:
> > The solution to your problem requires a third model: PeopleSkill.
> > Your
> > model defintions should then look as follows:
>
> > class Person extends AppModel {
> >var $hasMany = 'PeopleSkil';
> >var $recursive = 2;
>
> > }
>
> > class Skill extends AppModel {
> >var $hasMany = 'PeopleSkil';
> >var $recursive = 2;
>
> > }
>
> > class PeopleSkill extends AppModel {
> >var $hasOne = 'Person,Skill';
>
> > }
>
> > The real trick is in setting $recursive to 2.  Because of this, when
> > you query your Person model, it will pull the PeopleSkill model data,
> > and embedded within that data will be the associated Skill data.
> > This
> > structure will allow you to manage all the data as a cohesive unit.
>
> > thanks!
>
> > On 16 Ago, 23:13, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > > and if you add 'nate' to the search you will find just what you are
> > > looking for ;)
>
> > > On 8/16/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > > search the group for hasAndBelongsToMany and I bet you find a ton of 
> > > > help
>
> > > > 
>
> > > > On 8/16/07, Andrea <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello to everybody! I have a problem: I want to implement a many to
> > > > > many relation with a cross table that has other fields. I explain
> > > > > better with an example:
>
> > > > > Users
> > > > > -id
> > > > > -name
> > > > > -surname
>
> > > > > Groups
> > > > > -id
> > > > > -name
>
> > > > > Users_Groups
> > > > > -id
> > > > > -user_id
> > > > > -group-id
> > > > > -join_date
> > > > > -kind
>
> > > > > As you can see the entity Users_Groups is the "bridge" in order to
> > > > > achieve the M2M relation.
>
> > > > > I now how to implement a "normal" (without additional field on the
> > > > > bridge table) M2M relation with the variable $hasAndBelongsToMany in
> > > > > the model of each entity.
>
> > > > > In particular I need an example with some lines of code not only for
> > > > > the model but also for the controller and the view :D
>
> > > > > For example how can I "print" the kind of relation and the date of
> > > > > join for one user?
>
> > > > > Thanks!
>
> > > > > Ps. sorry for the little english, but I'm italian..
>
> > > > --
> > > > (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/
>
> > > --
> > > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > > - its a fine line between a real question and an idiot
>
> > >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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



Debug causing error

2007-08-17 Thread Langdon Stevenson

I am in the process of moving a number of Cake sites onto a new 
dedicated server (hosted with Superb Hosting).

This server runs the Plesk control panel.

I have already dealt with the known "open_basedir" issue and fixed that.

However I am now getting the following error when I call a page:


Warning:  fopen() function.fopen: SAFE MODE Restriction in effect.  The 
script whose uid is 10001 is not allowed to access / owned by uid 0 in 
/var/www/vhosts/customer_domain.com/httpdocs/cake/libs/file.php on line 105

[File] Could not open /debug.log with mode a!


It appear that the path to debug.log is not being set (or interpreted) 
correctly, so is upsetting things when I try to log anything.

This site is running on:

- Fedora Core 6
- PHP 5.1.6
- Plesk 8.2

If anyone has any suggestions as to why this is happening, or what to do 
to fix it, I would be grateful.

Regards,
Langdon

--~--~-~--~~~---~--~~
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: so many memory used when runing CAKEPHP

2007-08-17 Thread [EMAIL PROTECTED]

dear Hartjes

thanks for you help.


Chris Hartjes 写道:
> On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > hi
> >
> > thanks for you reply.
> >
> > but it do not happend in the other PHP application.
> >
>
> There is nothing inherent in CakePHP that causes it to use up all
> sorts of web server memory.  So, again, not a CakePHP issue.  Most
> likely an issue in your own code.
>
> I suggest you setup a debugger like XDebug or Zend Debugger and find
> out what's going on.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark - http://www.littlehart.net/attheballpark
> @TheKeyboard - http://www.littlehart.net/atthekeyboard


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



Re: css menu helper

2007-08-17 Thread Adam Royle

I accomplish this by setting a different layout in app_controller.php

Of course you need to make a new layout in views/layouts/admin.ctp,
which would implement your admin menu

class AppController extends Controller {

// add helpers, components, etc in here

function beforeFilter()
{
if (!empty($this->params[CAKE_ADMIN])){
// set our layout based on admin routing vars
$this->layout = "admin";
}
}

}


Hope that helps!
Adam

On Aug 17, 9:27 am, rtanz <[EMAIL PROTECTED]> wrote:
> hi i am trying to 
> implementhttp://bakery.cakephp.org/articles/view/css-menu-helper
> into my project.
>
> I would like to have 2 versions of this menu, one available in the
> front end of the site and another version for admin use. I am using
> cake's admin routing for my admin section.
>
> I would like some help regarding how to go about achieving this
> solution thanks


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



Problem with page's path

2007-08-17 Thread Andrea

Hi everybody!
I have this kind of problem with cake:

When I want to access to a specific view I use this path format:
http://localhost/APPNAME/index.php/CONTROLLER/VIEW/PARAMETERS

but when I navigate into the page created for example with the bake,
the format is like this: http://localhost/books/edit/2

So I receive a not found error by the browser.

I download yesterday the last stable versione of cake and I use MAMP
over a OSX.
I try to find something about this issue on the Internet but I can't
understand what's the matter...

What I have to configure?

Thanks!


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



Re: Many to Many relations - How to?

2007-08-17 Thread Andrea

Thanks to everybody! I've try it and I'm able to implements what I
wants...

Thanks!

Bye Andrea

On 17 Ago, 09:07, Andrea <[EMAIL PROTECTED]> wrote:
> Thanks to everybody I try this thing that suggests Nate in this 
> posthttp://groups.google.com/group/cake-php/browse_thread/thread/bef70558...
>
> Chris, I am so glad you asked, because this is why Cake Owns:
> The solution to your problem requires a third model: PeopleSkill.
> Your
> model defintions should then look as follows:
>
> class Person extends AppModel {
>var $hasMany = 'PeopleSkil';
>var $recursive = 2;
>
> }
>
> class Skill extends AppModel {
>var $hasMany = 'PeopleSkil';
>var $recursive = 2;
>
> }
>
> class PeopleSkill extends AppModel {
>var $hasOne = 'Person,Skill';
>
> }
>
> The real trick is in setting $recursive to 2.  Because of this, when
> you query your Person model, it will pull the PeopleSkill model data,
> and embedded within that data will be the associated Skill data.
> This
> structure will allow you to manage all the data as a cohesive unit.
>
> thanks!
>
> On 16 Ago, 23:13, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
>
> > and if you add 'nate' to the search you will find just what you are
> > looking for ;)
>
> > On 8/16/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > search the group for hasAndBelongsToMany and I bet you find a ton of help
>
> > > 
>
> > > On 8/16/07, Andrea <[EMAIL PROTECTED]> wrote:
>
> > > > Hello to everybody! I have a problem: I want to implement a many to
> > > > many relation with a cross table that has other fields. I explain
> > > > better with an example:
>
> > > > Users
> > > > -id
> > > > -name
> > > > -surname
>
> > > > Groups
> > > > -id
> > > > -name
>
> > > > Users_Groups
> > > > -id
> > > > -user_id
> > > > -group-id
> > > > -join_date
> > > > -kind
>
> > > > As you can see the entity Users_Groups is the "bridge" in order to
> > > > achieve the M2M relation.
>
> > > > I now how to implement a "normal" (without additional field on the
> > > > bridge table) M2M relation with the variable $hasAndBelongsToMany in
> > > > the model of each entity.
>
> > > > In particular I need an example with some lines of code not only for
> > > > the model but also for the controller and the view :D
>
> > > > For example how can I "print" the kind of relation and the date of
> > > > join for one user?
>
> > > > Thanks!
>
> > > > Ps. sorry for the little english, but I'm italian..
>
> > > --
> > > (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/
>
> > --
> > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > - its a fine line between a real question and an idiot
>
> >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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



Re: Practical effect of Mambo going with CakePHP?

2007-08-17 Thread keymaster

Not to pour water on anyone's enthusiasm... but, taking a realistic
point of view I don't think we are going to be impacted much in the
next little while.

Firstly, mambo hasn't started working on their 5.0 release yet. They
are still planning on releasing another 4.x release after the current
one. So, it seems, we are at least two releases away from seeing
anything.

Two releases in the opensource world can be an eternity.

I wouldn't hold your breath.

Also, I wouldn't be surprised if another smaller project built up a
CMS to the point where it has most of what people want, before the
mambo release comes out. Not nearly in the same league as what mambo
is trying to do, but have a look at DavidicusCMS on cakeForge. It is
the only cms on cakeforge which seems to be actively developed and is
starting to cover alot of the fundamentals. Lumad CMS seems to be
dead, but was a good start, perhaps someone may pick one of those up
and run with it.

However, when (if) mambo ever develops their 5.0 release, I'm sure it
will be something we can all benefit from (and they will benefit from
our comments and help as well).


--~--~-~--~~~---~--~~
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: Newbie: Is there a manual for Bake?

2007-08-17 Thread Dr. Tarique Sani

On 8/17/07, Aaron Roberson <[EMAIL PROTECTED]> wrote:
>
> What is the syntax in the console?
>

Ah! may be you can help me :)

I am supposed to write the documentation about Bake - tell me where
did you get stuck, what did you try and I will answer those
questions and ultimately incorporate those in the documentation.

Thanks in advance

Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.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: Many to Many relations - How to?

2007-08-17 Thread Andrea

Thanks to everybody I try this thing that suggests Nate in this post
http://groups.google.com/group/cake-php/browse_thread/thread/bef70558f7854732/6363603e04fcee68?lnk=st&q=&rnum=10#6363603e04fcee68

Chris, I am so glad you asked, because this is why Cake Owns:
The solution to your problem requires a third model: PeopleSkill.
Your
model defintions should then look as follows:

class Person extends AppModel {
   var $hasMany = 'PeopleSkil';
   var $recursive = 2;

}

class Skill extends AppModel {
   var $hasMany = 'PeopleSkil';
   var $recursive = 2;
}

class PeopleSkill extends AppModel {
   var $hasOne = 'Person,Skill';
}

The real trick is in setting $recursive to 2.  Because of this, when
you query your Person model, it will pull the PeopleSkill model data,
and embedded within that data will be the associated Skill data.
This
structure will allow you to manage all the data as a cohesive unit.

thanks!

On 16 Ago, 23:13, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> and if you add 'nate' to the search you will find just what you are
> looking for ;)
>
> On 8/16/07, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
>
> > search the group for hasAndBelongsToMany and I bet you find a ton of help
>
> > 
>
> > On 8/16/07, Andrea <[EMAIL PROTECTED]> wrote:
>
> > > Hello to everybody! I have a problem: I want to implement a many to
> > > many relation with a cross table that has other fields. I explain
> > > better with an example:
>
> > > Users
> > > -id
> > > -name
> > > -surname
>
> > > Groups
> > > -id
> > > -name
>
> > > Users_Groups
> > > -id
> > > -user_id
> > > -group-id
> > > -join_date
> > > -kind
>
> > > As you can see the entity Users_Groups is the "bridge" in order to
> > > achieve the M2M relation.
>
> > > I now how to implement a "normal" (without additional field on the
> > > bridge table) M2M relation with the variable $hasAndBelongsToMany in
> > > the model of each entity.
>
> > > In particular I need an example with some lines of code not only for
> > > the model but also for the controller and the view :D
>
> > > For example how can I "print" the kind of relation and the date of
> > > join for one user?
>
> > > Thanks!
>
> > > Ps. sorry for the little english, but I'm italian..
>
> > --
> > (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/
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/


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