Re: Connecting to pervasive.sql database

2008-02-11 Thread Unite

Sorry also wanted to know if cake-php can connect to the client
machine at all, so connect to the clients DB and pull information like
that or is it only basically localhost?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Connecting to pervasive.sql database

2008-02-11 Thread Unite

What would my DB file look like if i wanted to connect to a pervasive
(Pastel) database?

var $default = array('driver' => 'mysql',
'connect' => 'mysql_connect',
'host' => 'localhost',
'login' => '',
'password' => '',
'database' => 'DEMODATA',
'prefix' => '');

--~--~-~--~~~---~--~~
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: Access Documents Outside of Webroot

2008-02-11 Thread AussieFreelancer

hey thanks Tarique, I had a look and found the download method, which
I attempted and it works perfectly. :D thanks for your 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: select person in a table and then display events

2008-02-11 Thread Amit Badkas
On Feb 12, 2008 12:48 PM, jvandal <[EMAIL PROTECTED]> wrote:

>
> HI,
> I am new to cakephp and I want to select a person (by name)in a table
> and link it to another table 'events'  that will list all events
> related to that person.
> I want to do it on the same page.
> I would like an example of the cakephp code. I can create the tables
> in scaffolding but only displays all people and then list all events,
> but I can't understand how to create the code to do what I want.
> Thanks for any help
> Jim

 - If your events table has field 'user_id' which belongs to 'id' field in
users table then in User model by adding code var $hasMany =>
array('Event');, the events will be fetched for a user if you do find or
findAll for user

-- 
Regards,
Amit

http://amitrb.wordpress.com/
http://coppermine-gallery.net/
http://cheesecake-photoblog.org/
http://www.sanisoft.com/blog/author/amitbadkas

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



select person in a table and then display events

2008-02-11 Thread jvandal

HI,
I am new to cakephp and I want to select a person (by name)in a table
and link it to another table 'events'  that will list all events
related to that person.
I want to do it on the same page.
I would like an example of the cakephp code. I can create the tables
in scaffolding but only displays all people and then list all events,
but I can't understand how to create the code to do what I want.
Thanks for any help
Jim
--~--~-~--~~~---~--~~
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 for users in multiple groups

2008-02-11 Thread francky06l

I did face this scenario and came up with a solution using "profile".
A profile HABTM groups "with" ProfileGroup, and a user has one
profile.
The trick is to create an aro on each ProfileGroup and link them (ie:
by associating them using the parent_id). Then a user Aro pointing to
the first aro of the ProfileGroup. But you have to create a
ProfileGroup for every combination of groups available, but that can
be done (I had only 5 groups)..

hth



On Feb 12, 5:17 am, aranworld <[EMAIL PROTECTED]> wrote:
> Have you tried to just add one user to two groups in the console app
> and see what happens?
>
> I have just been reading through the check() function in cake\libs
> \controller\components\acl.php [DB_ACL].  I'm not 100% sure, but based
> on Nate's response above, I have a feeling that this is setup to
> actually work already.  Just give two entries in the aros table the
> same alias.  In fact, I wonder if the reliance on aliases is precisely
> to allow this to happen more easily?
>
> Although, I could imagine this causing problems with the AclBehavior.
>
> On Feb 11, 4:41 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > BTW, i was thinking the other day at solutions around this and thought
> > to duplicate the aro of a user for each group the user is in, and mark
> > this in the alias somehow. Then retrieve all the rights for all the
> > AROs of the user and try to solve conflicts between them. Since the
> > user is usually in few groups i think this is doable. I could even
> > write a new ACL behavior to do the duplication job for me.
> > What do you guys think? Does it worth trying?
>
> > On Feb 12, 2:21 am, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Interesting what you're saying. It's true that by carefully nesting
> > > groups you can solve a lot of cases but this leads to creating many
> > > groups that their only purpose is to nest other groups. I know that
> > > It's also true that solving conflicts in a "user in many groups"
> > > system would probably require as much effort, but even so... i wish i
> > > would know what nate's referring to, when he's saying that "This is
> > > technically possible with the new 1.2 ACL system" (in 
> > > here:https://trac.cakephp.org/ticket/2191)
>
> > > On Feb 12, 1:35 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > > You are right.  A user can only have one parent.  But that user does
> > > > not necessarily have to have the exact same permissions as it's
> > > > parent.
>
> > > > If you have a user in the "car mechanic" group, but this person also
> > > > has experience fixing bicycle tires, you could give that person -- and
> > > > that person only -- access to the BicycleTire controller, which is
> > > > otherwise only available to those in the "bike mechanic" group.
>
> > > > You can, of course, also nest groups.  So if you want to give bike
> > > > mechanics access to only bikes, but car mechanics access to bikes and
> > > > cars, you could make bike mechanics the parent of car mechanics.  In
> > > > this case, car mechanics will inherit all from bikes (their parent),
> > > > but then you can assign whatever extra permissions you want to the car
> > > > mechanics without having those permissions applied to bike mechanics.
> > > > However, if you have a car mechanic who knows nothing about bikes, you
> > > > can then revoke all his permissions to bicycles, but keep him in the
> > > > car mechanic group.
>
> > > > On Feb 10, 10:35 pm, "[EMAIL PROTECTED]"
>
> > > > <[EMAIL PROTECTED]> wrote:
> > > > > Can the current ACL system be used for this situation: the requester
> > > > > (user) can have multiple parents (groups) ? From what i see the
> > > > > inheritance in aros is 1:1 for now. What do you guys use?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model primarykey

2008-02-11 Thread adammc84

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 ?
--~--~-~--~~~---~--~~
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: Access Documents Outside of Webroot

2008-02-11 Thread Dr. Tarique Sani

On Feb 12, 2008 10:59 AM, AussieFreelancer
<[EMAIL PROTECTED]> wrote:

>
> Solution:
>
> The solution I thought of, was to store these documents above the
> webroot. So now I have got them saving to .../public/uploads instead
> of .../public/app/webroot/files.. etc
>
> New Problem:
>
> haha, so now my new problem, is it actually possible to access these
> documents? I am writing a controller method that will check if they
> have permission to view the document, and if they do, it should open
> the document somehow, either by redirect, or some other format.
>

Take a look at "media View" which will allow you to read files from
anywhere in the system and serve them (optionally you can also offer
them for downloads) - You can apply your ACL in your controller

Search this group for "media view" or "protected downloads"

HTH

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: Using a full controller by other. The ultimate software design question.

2008-02-11 Thread Adam Royle

I'm not sure I understand fully what you are trying to do, however why
can't you use normal variables to determine this kind of behaviour?
eg. either swap the view based on the mode, or do if/else statements
in your view.

Without more info (and a code example if you can) I can't really
suggest anything else.

Adam

On Feb 12, 2:41 pm, MX <[EMAIL PROTECTED]> wrote:
> Hey,
>
> Well I am coding this *simple* website which has users, articles and
> images. Its the simple scenary.
> It contains a front and backend all action-separated with proper
> "admin" pre-named.
>
> The images controller offers the administrators the oportunity to
> list, upload, edit and delete the images.
> The interface is a simple CRUD.
>
> But it comes to the point that I want to include an image (existing or
> new) to an Article.
> Not that matters but the rich editor triggers a popup which displays
> the Images options.
>
> The problem comes here. Well right now I am playing with setting a
> "simpler" layout, by passing a condition on the URI: admin/images/
> mode:inline.
>
> But the problem is that I must update ALL links of the Images views,
> to "transport" the "mode" condition.
> So a link to admin/images/upload, must carry out the "mode:inline", if
> mode is present.
> This results in views being able to service both scenarios: accessed
> directly as a controller or by the popup.
> But this is not a clean solution, neither is readable (come across +
> 10 links, all with same code.)
>
> What do you suggest? It would be fine (and not an hack, but an honest
> solution) if it was possible to mantain certain *persistent*
> conditions on the URI automaticly.
>
> But I want an MVC (not just because its cool, but as a part of code
> organization/optimization) and this problem will be an example for
> future projects.
>
> Hope you help, 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
-~--~~~~--~~--~--~---



Access Documents Outside of Webroot

2008-02-11 Thread AussieFreelancer

Hi All, I am not sure if this is possible, but I am hoping it is...

Problem:

My client's website has hundreds of members, and each member can have
permissions and a user group associated with them. An administrator
who has permission to manage employees, needs to be able to open
documents relating to that employee, such as resume, references, etc.
These documents could be .doc, .xls, .pdf, whatever. Before this
system was in place (allowing members etc), they stored their
documents online, and protected it with htpasswd.

When I developed the current system for them, this is how I also did
it. Documents are in a folder in the webroot, which is protected
using .htpasswd.

However... now they have requested that the .htpasswd be dynamic, so
that an admin user with "manage employees" permissions has their
username and password linked to it, including the password being
updated whenever the user updates their password.

I didn't think this was possible, and if it was, then it would be
complex.

Solution:

The solution I thought of, was to store these documents above the
webroot. So now I have got them saving to .../public/uploads instead
of .../public/app/webroot/files.. etc

New Problem:

haha, so now my new problem, is it actually possible to access these
documents? I am writing a controller method that will check if they
have permission to view the document, and if they do, it should open
the document somehow, either by redirect, or some other format.

I am guessing perhaps there is a modification to make to the .htaccess
file to allow access to these documents, but it needs to be secure
enough so that someone can't just put the doc name into the url and
bypass the controller.

Hopefully that akes sense, if someone has a suggestion on how best to
achieve this, I would appreciate it.

Thanks

Patrick
--~--~-~--~~~---~--~~
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 a full controller by other. The ultimate software design question.

2008-02-11 Thread MX

Hey,

Well I am coding this *simple* website which has users, articles and
images. Its the simple scenary.
It contains a front and backend all action-separated with proper
"admin" pre-named.

The images controller offers the administrators the oportunity to
list, upload, edit and delete the images.
The interface is a simple CRUD.

But it comes to the point that I want to include an image (existing or
new) to an Article.
Not that matters but the rich editor triggers a popup which displays
the Images options.

The problem comes here. Well right now I am playing with setting a
"simpler" layout, by passing a condition on the URI: admin/images/
mode:inline.

But the problem is that I must update ALL links of the Images views,
to "transport" the "mode" condition.
So a link to admin/images/upload, must carry out the "mode:inline", if
mode is present.
This results in views being able to service both scenarios: accessed
directly as a controller or by the popup.
But this is not a clean solution, neither is readable (come across +
10 links, all with same code.)

What do you suggest? It would be fine (and not an hack, but an honest
solution) if it was possible to mantain certain *persistent*
conditions on the URI automaticly.

But I want an MVC (not just because its cool, but as a part of code
organization/optimization) and this problem will be an example for
future projects.

Hope you help, 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: ACL for users in multiple groups

2008-02-11 Thread aranworld

Have you tried to just add one user to two groups in the console app
and see what happens?

I have just been reading through the check() function in cake\libs
\controller\components\acl.php [DB_ACL].  I'm not 100% sure, but based
on Nate's response above, I have a feeling that this is setup to
actually work already.  Just give two entries in the aros table the
same alias.  In fact, I wonder if the reliance on aliases is precisely
to allow this to happen more easily?

Although, I could imagine this causing problems with the AclBehavior.

On Feb 11, 4:41 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> BTW, i was thinking the other day at solutions around this and thought
> to duplicate the aro of a user for each group the user is in, and mark
> this in the alias somehow. Then retrieve all the rights for all the
> AROs of the user and try to solve conflicts between them. Since the
> user is usually in few groups i think this is doable. I could even
> write a new ACL behavior to do the duplication job for me.
> What do you guys think? Does it worth trying?
>
> On Feb 12, 2:21 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Interesting what you're saying. It's true that by carefully nesting
> > groups you can solve a lot of cases but this leads to creating many
> > groups that their only purpose is to nest other groups. I know that
> > It's also true that solving conflicts in a "user in many groups"
> > system would probably require as much effort, but even so... i wish i
> > would know what nate's referring to, when he's saying that "This is
> > technically possible with the new 1.2 ACL system" (in 
> > here:https://trac.cakephp.org/ticket/2191)
>
> > On Feb 12, 1:35 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > > You are right.  A user can only have one parent.  But that user does
> > > not necessarily have to have the exact same permissions as it's
> > > parent.
>
> > > If you have a user in the "car mechanic" group, but this person also
> > > has experience fixing bicycle tires, you could give that person -- and
> > > that person only -- access to the BicycleTire controller, which is
> > > otherwise only available to those in the "bike mechanic" group.
>
> > > You can, of course, also nest groups.  So if you want to give bike
> > > mechanics access to only bikes, but car mechanics access to bikes and
> > > cars, you could make bike mechanics the parent of car mechanics.  In
> > > this case, car mechanics will inherit all from bikes (their parent),
> > > but then you can assign whatever extra permissions you want to the car
> > > mechanics without having those permissions applied to bike mechanics.
> > > However, if you have a car mechanic who knows nothing about bikes, you
> > > can then revoke all his permissions to bicycles, but keep him in the
> > > car mechanic group.
>
> > > On Feb 10, 10:35 pm, "[EMAIL PROTECTED]"
>
> > > <[EMAIL PROTECTED]> wrote:
> > > > Can the current ACL system be used for this situation: the requester
> > > > (user) can have multiple parents (groups) ? From what i see the
> > > > inheritance in aros is 1:1 for now. What do you guys use?
--~--~-~--~~~---~--~~
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: SQL Error: 1066: Not unique table/alias when deleting data

2008-02-11 Thread nate

Could you post the full SQL query that generated the error?  How about
the method call you made to generate the error?  Maybe your model code/
associations?  As it is, we can't really help you much with that
description.

On Feb 11, 10:00 pm, Action <[EMAIL PROTECTED]> wrote:
> Warning (512): SQL Error: 1066: Not unique table/alias: 'PostsTag'
>
> Warning (512): SQL Error: 1066: Not unique table/alias: 'Post'
>
> This only happens on my shared host (mysql 4.0), not my local host
> (mysql 5.0.45).
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SQL Error: 1066: Not unique table/alias when deleting data

2008-02-11 Thread Action

Warning (512): SQL Error: 1066: Not unique table/alias: 'PostsTag'

Warning (512): SQL Error: 1066: Not unique table/alias: 'Post'


This only happens on my shared host (mysql 4.0), not my local host
(mysql 5.0.45).
--~--~-~--~~~---~--~~
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: DATETIME and ADMIN ROUTING broken when moving to shared host. HELP!!

2008-02-11 Thread Action

A little more info on the admin_delete problem. It's the only admin
function without a corresponding view, but it redirects before a view
is rendered so it shouldn't matter (and it works perfectly on my local
server), but it doesn't work on my shared host:

function admin_delete($id = null)
{
$this->autoRender = false;
if(!$id)
{
$this->redirect(array('action' => 'index'));
}
if($this->Post->del($id))
{
$this->Session->setFlash('Post #'.$id.' deleted.', 
$layout =
'flash_success');
$this->redirect(array('action' => 'index'));
}
}

On Feb 11, 8:53 pm, Action <[EMAIL PROTECTED]> wrote:
> So, I finished my app and everything works fine on my local server.
> Now that I've uploaded it to my shared host (1&1), I am having 2
> problems:
>
> 1) Cake is saving "December 31, 1969, 7:00 PM" into my "created" field
> every time instead of the correct date. I've used Cake before on 1&1
> and never had this problem.
>
> 2) I get "Not Found   Error: The requested address 'admin_delete' was
> not found on this server." when I call my admin_delete function. All
> of the other admin functions (admin_edit, admin_view, etc.) work
> fine...
>
> Any ideas?
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread Baz

Sometimes it's hard to really "read" email/posts.

As I said, CakePHP has helped me a lot, and since I'm not a great
coder, I'm trying to give back in anyway I can.

On Feb 11, 2008 8:16 PM, nate <[EMAIL PROTECTED]> wrote:
>
> That didn't seem sarcastic to me at all, but maybe you thought that
> because that's becoming part of a pervasive attitude around here.  If
> that's the case, we need to fix that.
>
> Baz, you make some good points.  If you're interested, you and I can
> have an offline discussion about drafting some sort of conduct policy
> along the lines of your suggestions.
>
> On Feb 11, 8:05 pm, Baz <[EMAIL PROTECTED]> wrote:
> > Hey, I was just trying to help. CakePHP has opened a lot of doors for
> > me, but I personally think that the process could be a lil' less
> > painful.
> >
> > On Feb 11, 2008 6:43 PM, DragonI <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Baz,
> >
> > > You've hit the nail on the head from both ends :) You should post this
> > > on your blog.
> >
> > I sense sarcasm, but I can't exactly be sure...
> >
> > > The result will be novices/newbies will just say screw it and move on
> > > to another more friendly community. The seasoned cakers will get
> > > frustrated and stop helping/mentoring. This is absolutely lose lose
> > > situation.
> >
> > The result of what, my suggestions?
> >
> > > The lessons I've learned over time is that no matter how good your
> > > product is, if no one can use it then your product fails. Just look at
> > > all of the database companies who have come and gone. My corporate
> > > friends are MS SQL server freaks who love it because MS made it easier
> > > to use/admin then it's father - Sybase. So look at where Sybase is
> > > today compared to MS.
> >
> > So is there a proposal here?
>
> >
>

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

2008-02-11 Thread nate

That didn't seem sarcastic to me at all, but maybe you thought that
because that's becoming part of a pervasive attitude around here.  If
that's the case, we need to fix that.

Baz, you make some good points.  If you're interested, you and I can
have an offline discussion about drafting some sort of conduct policy
along the lines of your suggestions.

On Feb 11, 8:05 pm, Baz <[EMAIL PROTECTED]> wrote:
> Hey, I was just trying to help. CakePHP has opened a lot of doors for
> me, but I personally think that the process could be a lil' less
> painful.
>
> On Feb 11, 2008 6:43 PM, DragonI <[EMAIL PROTECTED]> wrote:
>
>
>
> > Baz,
>
> > You've hit the nail on the head from both ends :) You should post this
> > on your blog.
>
> I sense sarcasm, but I can't exactly be sure...
>
> > The result will be novices/newbies will just say screw it and move on
> > to another more friendly community. The seasoned cakers will get
> > frustrated and stop helping/mentoring. This is absolutely lose lose
> > situation.
>
> The result of what, my suggestions?
>
> > The lessons I've learned over time is that no matter how good your
> > product is, if no one can use it then your product fails. Just look at
> > all of the database companies who have come and gone. My corporate
> > friends are MS SQL server freaks who love it because MS made it easier
> > to use/admin then it's father - Sybase. So look at where Sybase is
> > today compared to MS.
>
> So is there a proposal here?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DATETIME and ADMIN ROUTING broken when moving to shared host. HELP!!

2008-02-11 Thread Action

So, I finished my app and everything works fine on my local server.
Now that I've uploaded it to my shared host (1&1), I am having 2
problems:

1) Cake is saving "December 31, 1969, 7:00 PM" into my "created" field
every time instead of the correct date. I've used Cake before on 1&1
and never had this problem.

2) I get "Not Found   Error: The requested address 'admin_delete' was
not found on this server." when I call my admin_delete function. All
of the other admin functions (admin_edit, admin_view, etc.) work
fine...

Any ideas?
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread Baz

Hey, I was just trying to help. CakePHP has opened a lot of doors for
me, but I personally think that the process could be a lil' less
painful.

On Feb 11, 2008 6:43 PM, DragonI <[EMAIL PROTECTED]> wrote:
>
> Baz,
>
> You've hit the nail on the head from both ends :) You should post this
> on your blog.

I sense sarcasm, but I can't exactly be sure...

> The result will be novices/newbies will just say screw it and move on
> to another more friendly community. The seasoned cakers will get
> frustrated and stop helping/mentoring. This is absolutely lose lose
> situation.

The result of what, my suggestions?

> The lessons I've learned over time is that no matter how good your
> product is, if no one can use it then your product fails. Just look at
> all of the database companies who have come and gone. My corporate
> friends are MS SQL server freaks who love it because MS made it easier
> to use/admin then it's father - Sybase. So look at where Sybase is
> today compared to MS.

So is there a proposal here?

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



cakephp tree behavior + ext js (drag and drop)

2008-02-11 Thread Adam Royle

Hi all,

I have just finished writing a tutorial that explains how to use the
Tree Behavior, and edit the structure using drag and drop and ajax,
with help from the Ext JS TreePanel component.

http://blogs.bigfish.tv/adam/2008/02/12/drag-and-drop-using-ext-js-with-the-cakephp-tree-behavior/

I appreciate any feedback you might have on this, or any questions you
have on getting it working. It's my first real tutorial, but I have a
few more tutorials in the pipeline so subscribe to my RSS feed.

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



database issue

2008-02-11 Thread adammc84

Can anybody help me out and tell me what i am doing wrong.

I am using cake 1.2

when i use pr( $user ) to view the data returned from a find call on
my Model 'User',  i receive data from 'ActiveUser' Model - which i
would expect BUT i have set recursive to -1 in the 'find' call.

MySql database

Table 'users' PrimaryKey = user_id
Table 'active_users' PrimaryKey = user_id, d_id

users 0..N entry's in active_users table

CakePHP

models/user.php
view here -> http://bin.cakephp.org/view/1197815829

models/activeuser.php
view here ->
http://bin.cakephp.org/view/1501988477

*i call pr($user) in the user.php Model validateLogin() method.

i receive the following * i don't want 'ActiveUser' data only 'User'
thats why i have set recursive to -1 in the find call

*note that i use 'ActiveUser' in other parts in the application, i
need to limit the data returned for the Auth component and i don't
understand what i am doing wrong

Thanks

---
I GET THIS

Array
(
[User] => Array
(
[user_id] => 133
[username] => [EMAIL PROTECTED]
)

[ActiveUser] => Array
(
[0] => Array
(
[last_activity] => -00-00 00:00:00
[user_id] => 142
[d_id] => bff24d0c3cdfc3d8592501cfb712df98
)

[1] => Array
(
[last_activity] => 2008-01-27 15:31:34
[user_id] => 142
[d_id] => faa4069119f9bf64f33ba3e6fc21eaf2
)

)

)

-

I WANT THIS

Array
(
[User] => Array
(
[user_id] => 133
[username] => [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
-~--~~~~--~~--~--~---



Re: behavior acts_as_list

2008-02-11 Thread DragonI

Baz,

You've hit the nail on the head from both ends :) You should post this
on your blog.

The result will be novices/newbies will just say screw it and move on
to another more friendly community. The seasoned cakers will get
frustrated and stop helping/mentoring. This is absolutely lose lose
situation.

The lessons I've learned over time is that no matter how good your
product is, if no one can use it then your product fails. Just look at
all of the database companies who have come and gone. My corporate
friends are MS SQL server freaks who love it because MS made it easier
to use/admin then it's father - Sybase. So look at where Sybase is
today compared to MS.

On Feb 11, 5:56 pm, Baz <[EMAIL PROTECTED]> wrote:
> Please excuse my babbling, but this is a problem we always have on this
> mailing list (and others I've been a part of) and I'm not sure how we would
> go about resolving issues such as these:
>
>1. Novice asks a question
>2. Member flames novice for not reading/searching, etc.
>3. Member points to some previous post that pseudo helps
>4. Novice doesn't understand and asks again.
>5. Everyone gets mad, no one gets helped.
>
> Is there anyway we can avoid issues like these? I've been on both sides of
> the fence and it's not fun on either one. Maybe with a few suggestions we
> can avoid these in the future? (Please note these are NOT *directly* related
> to this post)
>
> Novices:
>
>- Please do a lil' bit of footwork. That is one thing that annoys
>members a lot. No one likes to help someone who doesn't want to help
>themselves.
>- Be polite with your questions.
>- Give examples (links, paste bins) of what you've tried and why it
>didn't work.
>- Give proper errors or descriptions of problems. "It doesn't work"
>doesn't mean much to anyone other than you.
>- Trust members when they point you somewhere and take some time to
>read through suggestions before reposting that it doesn't work.
>
> Members:
>
>- This is a big one. Please try to understand that CakePHP is very
>intimidating to novices and sometimes people need *exact* examples.
>Not "hunt through this post with 12 different replies and try to pluck out
>something that may work for you"
>- Along the lines of the above point, try to differentiate when you're
>pointing to an *exact* solution and *reference *material. Then the
>person knows what to expect.
>- Try to understand that you guys live and breath this thing. Some
>things just aren't clear to some people. It took me months before I could
>figure out 1/4 of the stuff that the $options array does in the $form 
> helper
>by reading through the api.
>- Try to be patient. I know it comes easy to you, but people wouldn't
>be asking if the answer was obvious.
>- Try to understand a novice's question first before pointing them to
>some general solution.
>- Sometimes an explanation is worth a lot more than a link to an old
>thread/post/etc. Code isn't as clear to others as it is to you.
>- Try not to look down on the ignorant. You, of all people, should
>appreciate the complexities of CakePHP.
>
> I must say that I've been guilty of all of the above on some occasion or the
> other.
>
> Before you ask/answer a question, try to look at it from the other person's
> perspective before you hit the send button.
>
> Question: Why don't we have a rules and regulations text (one the homepage
> of the group perhaps?) that states policies on question asking such as
> researching, reading, duplicates, etc?
>
> Just my 2 cents
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.com/
>
> On Feb 11, 2008 4:23 PM, sbeam <[EMAIL PROTECTED]> wrote:
>
>
>
> > look, thanks for the finger wagging and challenge to a sword fight but
> > I'll pass. I did find the thread and the code you linked to a long
> > time ago. I rejected it because the comments mentioned MPTT, which
> > again I don't need, plus it is totally incomprehensible to me. I tried
> > the grigri stuff too but it didn't quite work.
>
> > In any case I did also find this which is almost working and is more
> > clear:
> >http://bin.cakephp.org/saved/21838
>
> > I am new to Cake and expected this to be in Bakery, so when it wasn't
> > I thought I would ask if there was any progress I was missing, besides
> > these heaps of code in pastebin which I didn't understand. Sorry if my
> > post disturbed you.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: ACL for users in multiple groups

2008-02-11 Thread [EMAIL PROTECTED]

BTW, i was thinking the other day at solutions around this and thought
to duplicate the aro of a user for each group the user is in, and mark
this in the alias somehow. Then retrieve all the rights for all the
AROs of the user and try to solve conflicts between them. Since the
user is usually in few groups i think this is doable. I could even
write a new ACL behavior to do the duplication job for me.
What do you guys think? Does it worth trying?

On Feb 12, 2:21 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Interesting what you're saying. It's true that by carefully nesting
> groups you can solve a lot of cases but this leads to creating many
> groups that their only purpose is to nest other groups. I know that
> It's also true that solving conflicts in a "user in many groups"
> system would probably require as much effort, but even so... i wish i
> would know what nate's referring to, when he's saying that "This is
> technically possible with the new 1.2 ACL system" (in 
> here:https://trac.cakephp.org/ticket/2191)
>
> On Feb 12, 1:35 am, aranworld <[EMAIL PROTECTED]> wrote:
>
> > You are right.  A user can only have one parent.  But that user does
> > not necessarily have to have the exact same permissions as it's
> > parent.
>
> > If you have a user in the "car mechanic" group, but this person also
> > has experience fixing bicycle tires, you could give that person -- and
> > that person only -- access to the BicycleTire controller, which is
> > otherwise only available to those in the "bike mechanic" group.
>
> > You can, of course, also nest groups.  So if you want to give bike
> > mechanics access to only bikes, but car mechanics access to bikes and
> > cars, you could make bike mechanics the parent of car mechanics.  In
> > this case, car mechanics will inherit all from bikes (their parent),
> > but then you can assign whatever extra permissions you want to the car
> > mechanics without having those permissions applied to bike mechanics.
> > However, if you have a car mechanic who knows nothing about bikes, you
> > can then revoke all his permissions to bicycles, but keep him in the
> > car mechanic group.
>
> > On Feb 10, 10:35 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Can the current ACL system be used for this situation: the requester
> > > (user) can have multiple parents (groups) ? From what i see the
> > > inheritance in aros is 1:1 for now. What do you guys use?
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread sbeam

On Feb 11, 5:46 pm, AD7six <[EMAIL PROTECTED]> wrote:
> b) addresses exactly what you were asking for
> c) the code I posted /borrows/ logic from the tree behavior - it's is
> not for hierachial data it's for flat lists.

none of which is /obvious/ except to you, the author

> Don't worry though I'll remember not to point out the obvious to you
> in the future

works for 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 for users in multiple groups

2008-02-11 Thread [EMAIL PROTECTED]

Interesting what you're saying. It's true that by carefully nesting
groups you can solve a lot of cases but this leads to creating many
groups that their only purpose is to nest other groups. I know that
It's also true that solving conflicts in a "user in many groups"
system would probably require as much effort, but even so... i wish i
would know what nate's referring to, when he's saying that "This is
technically possible with the new 1.2 ACL system" (in here:
https://trac.cakephp.org/ticket/2191 )

On Feb 12, 1:35 am, aranworld <[EMAIL PROTECTED]> wrote:
> You are right.  A user can only have one parent.  But that user does
> not necessarily have to have the exact same permissions as it's
> parent.
>
> If you have a user in the "car mechanic" group, but this person also
> has experience fixing bicycle tires, you could give that person -- and
> that person only -- access to the BicycleTire controller, which is
> otherwise only available to those in the "bike mechanic" group.
>
> You can, of course, also nest groups.  So if you want to give bike
> mechanics access to only bikes, but car mechanics access to bikes and
> cars, you could make bike mechanics the parent of car mechanics.  In
> this case, car mechanics will inherit all from bikes (their parent),
> but then you can assign whatever extra permissions you want to the car
> mechanics without having those permissions applied to bike mechanics.
> However, if you have a car mechanic who knows nothing about bikes, you
> can then revoke all his permissions to bicycles, but keep him in the
> car mechanic group.
>
> On Feb 10, 10:35 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Can the current ACL system be used for this situation: the requester
> > (user) can have multiple parents (groups) ? From what i see the
> > inheritance in aros is 1:1 for now. What do you guys use?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Baked views and hasOne / belongsTo relationship

2008-02-11 Thread loki_mdog


Hi there Bakers --

I have two tables that are joined via a belongsTo and hasOne relationship. 
When I bake my views for the "parent" table...none of the "child" table
fields show up in the index or edit screens...

If I look at the generated SQL, the relationships work and when pasted into
a db...all the data from both tables comes back as one row...just isn't
displayed on the index or edit pages.

Also, I can manually get the fields to show and display data from the
database but I am wondering why cake bake isn't putting the data into the
view by default...I wonder about this because a previous version of cake did
in fact do this...

Is there any way to force cake bake to include this child table fields in
the generated views of the parent?  Obviously, I can add them myself but if
I can get cake bake to do it for me, all the better.

Many thanks!
-- 
View this message in context: 
http://www.nabble.com/Baked-views-and-hasOne---belongsTo-relationship-tp15423574p15423574.html
Sent from the CakePHP mailing list archive at Nabble.com.


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



Re: using php-cli with cake

2008-02-11 Thread Robby Anderson


You might also look here to use the cake console command. With that,
you could build a class that wraps a controller and calls the
specified action.

http://cakebaker.42dh.com/2007/05/07/writing-a-custom-cakephp-console-script/

--~--~-~--~~~---~--~~
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 for users in multiple groups

2008-02-11 Thread aranworld

You are right.  A user can only have one parent.  But that user does
not necessarily have to have the exact same permissions as it's
parent.

If you have a user in the "car mechanic" group, but this person also
has experience fixing bicycle tires, you could give that person -- and
that person only -- access to the BicycleTire controller, which is
otherwise only available to those in the "bike mechanic" group.

You can, of course, also nest groups.  So if you want to give bike
mechanics access to only bikes, but car mechanics access to bikes and
cars, you could make bike mechanics the parent of car mechanics.  In
this case, car mechanics will inherit all from bikes (their parent),
but then you can assign whatever extra permissions you want to the car
mechanics without having those permissions applied to bike mechanics.
However, if you have a car mechanic who knows nothing about bikes, you
can then revoke all his permissions to bicycles, but keep him in the
car mechanic group.

On Feb 10, 10:35 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Can the current ACL system be used for this situation: the requester
> (user) can have multiple parents (groups) ? From what i see the
> inheritance in aros is 1:1 for now. What do you guys use?
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread Robby Anderson


On Feb 11, 4:56 pm, Baz <[EMAIL PROTECTED]> wrote:
> Question: Why don't we have a rules and regulations text (one the homepage
> of the group perhaps?) that states policies on question asking such as
> researching, reading, duplicates, etc?

I'd submit that one is necessary for answering questions, 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: Dynamic parentID() when using ACL

2008-02-11 Thread aranworld

Sorry, I posted that too early. Let me try again:

When Auth checks the Acl tables to give permission, it is using an
Alias based on the Controller/action pair -- if you are using Auth
under 'actions' mode.

Under 'crud' mode, it checks for an alias using just the Controller
name.

Thus, for each forum, you are going to be required to create unique
Controller/action strings.  For example, for the part where people
talk about cars, your aliases might look like this:

CarEnthusiastForum
-- add
-- edit
-- delete
-- index

For the Television forum

TVFansForum
-- add
-- edit
-- delete
-- index

With such a setup, it then becomes quite easy to just give the admin
of the Car Forum all permissions to the CarEnthusiastForum controller,
but only give him member permissions on the TVFansForum controller.

Obviously you might have a more complex set of controllers
( CarForumPosts, CarForumTopics etc... ), but the basic idea is that
each forum is going to have to have a unique set of controllers for
this to work.

On Feb 11, 3:15 pm, aranworld <[EMAIL PROTECTED]> wrote:
> When Auth checks the Acl tables to give permission, it is using an
> Alias based on the Controller/action pair.
>
> Thus, for each forum, you are going to be required to create unique
> Controller/action strings.  For example, for the part where people
> talk about cars, your aliases might look like this:
>
> CarEnthusiastForum
> add
> CarEnthusiastForum/edit
> CarEnthusiastForum/delete
> CarEnthusiastForum/index
>
> On Feb 11, 6:18 am, boyracerr <[EMAIL PROTECTED]> wrote:
>
> > Hello to all,
>
> > I am keen to use ACL in my application. However, the requirement that
> > users only be in one group seems to me to be a massive obstacle.
>
> > As an example, imagine there is a bulletin board application with many
> > forums. Each forum will have members, moderators and administrators.
> > An administrator in one group may be only a member of another group
> > and so on.
>
> > I thought up a possible solution to the above, and I would appreciate
> > comments. As I understand it, tree navigation (and thus cascading
> > permissions) is implemented using the parentID() function, implemented
> > in the relevant model.
>
> > Would it be possible to write the parentID() function such that it
> > returned a different parentID depending on the current location in the
> > site.
>
> > For example:
>
> > User visits Forum1. He is only a member of this forum. parentID()
> > knows that he is visiting that particular forum, and thus returns
> > Forum1.members as the relevant parent group.
>
> > User visits Forum2. He is an administrator of this forum. parentID(),
> > based on the forum being viewed, returns Forum2.admins as the relevant
> > parent group.
>
> > Comments on the above? Would it work? Would it solve this problem?
>
> > Thanks,
> > Benjamin
--~--~-~--~~~---~--~~
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: Auth Problems

2008-02-11 Thread aranworld

Also, it is important to note under which mode you are using Auth.
For example, I am using 'actions' mode alongside the AclComponent.  In
this case, I use the following:

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

On Feb 11, 11:27 am, Baz <[EMAIL PROTECTED]> wrote:
> Here's a shameless plug for my site:
>
> http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/
>
> There's some sample code you can download there and compare certain things.
>
> On Feb 11, 2008 1:21 PM, Chris Hartjes <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Feb 11, 2008 2:05 PM, Neil <[EMAIL PROTECTED]> wrote:
>
> > > Thanks, but that is not the problem then because in my current setup &
> > > for testing I put"
> > > var $components = array('Auth');
> > > in every controller instead of app_controller and it still did not
> > > work.
>
> > Dude, I have no idea why it's not working for you.  All the advice
> > you've been given is enough to get you going.  Here's a handy
> > checklist that I use when doing Auth
>
> > 1) Have I included the component everywhere I want
> > 2) Have I created the database for the model I'm using for Auth
> > 3) Have I created the Model for the database I'm using for Auth
> > 4) Have I created my login action and view
> > 5) Have I set the correct parameters in my beforeFilter() depending on
> > my particular scenario
> > 6) I have read over some of these fine sources of documentation on
> > using Auth (I happened to have written them):
>
> >http://tempdocs.cakephp.org/#TOC14
> >http://www.littlehart.net/atthekeyboard/?s=Auth
>
> > If you've gone through all that and *still* can't get it to work,
> > well, you've fucked something up and need to really debug stuff.  Yes,
> > I've made mistakes too despite all the fine info listed above but I
> > always figure it out in the end.
>
> > --
> > 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 "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: Dynamic parentID() when using ACL

2008-02-11 Thread aranworld

When Auth checks the Acl tables to give permission, it is using an
Alias based on the Controller/action pair.

Thus, for each forum, you are going to be required to create unique
Controller/action strings.  For example, for the part where people
talk about cars, your aliases might look like this:

CarEnthusiastForum
add
CarEnthusiastForum/edit
CarEnthusiastForum/delete
CarEnthusiastForum/index

On Feb 11, 6:18 am, boyracerr <[EMAIL PROTECTED]> wrote:
> Hello to all,
>
> I am keen to use ACL in my application. However, the requirement that
> users only be in one group seems to me to be a massive obstacle.
>
> As an example, imagine there is a bulletin board application with many
> forums. Each forum will have members, moderators and administrators.
> An administrator in one group may be only a member of another group
> and so on.
>
> I thought up a possible solution to the above, and I would appreciate
> comments. As I understand it, tree navigation (and thus cascading
> permissions) is implemented using the parentID() function, implemented
> in the relevant model.
>
> Would it be possible to write the parentID() function such that it
> returned a different parentID depending on the current location in the
> site.
>
> For example:
>
> User visits Forum1. He is only a member of this forum. parentID()
> knows that he is visiting that particular forum, and thus returns
> Forum1.members as the relevant parent group.
>
> User visits Forum2. He is an administrator of this forum. parentID(),
> based on the forum being viewed, returns Forum2.admins as the relevant
> parent group.
>
> Comments on the above? Would it work? Would it solve this problem?
>
> Thanks,
> Benjamin
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread Baz
Please excuse my babbling, but this is a problem we always have on this
mailing list (and others I've been a part of) and I'm not sure how we would
go about resolving issues such as these:


   1. Novice asks a question
   2. Member flames novice for not reading/searching, etc.
   3. Member points to some previous post that pseudo helps
   4. Novice doesn't understand and asks again.
   5. Everyone gets mad, no one gets helped.

Is there anyway we can avoid issues like these? I've been on both sides of
the fence and it's not fun on either one. Maybe with a few suggestions we
can avoid these in the future? (Please note these are NOT *directly* related
to this post)

Novices:

   - Please do a lil' bit of footwork. That is one thing that annoys
   members a lot. No one likes to help someone who doesn't want to help
   themselves.
   - Be polite with your questions.
   - Give examples (links, paste bins) of what you've tried and why it
   didn't work.
   - Give proper errors or descriptions of problems. "It doesn't work"
   doesn't mean much to anyone other than you.
   - Trust members when they point you somewhere and take some time to
   read through suggestions before reposting that it doesn't work.

Members:

   - This is a big one. Please try to understand that CakePHP is very
   intimidating to novices and sometimes people need *exact* examples.
   Not "hunt through this post with 12 different replies and try to pluck out
   something that may work for you"
   - Along the lines of the above point, try to differentiate when you're
   pointing to an *exact* solution and *reference *material. Then the
   person knows what to expect.
   - Try to understand that you guys live and breath this thing. Some
   things just aren't clear to some people. It took me months before I could
   figure out 1/4 of the stuff that the $options array does in the $form helper
   by reading through the api.
   - Try to be patient. I know it comes easy to you, but people wouldn't
   be asking if the answer was obvious.
   - Try to understand a novice's question first before pointing them to
   some general solution.
   - Sometimes an explanation is worth a lot more than a link to an old
   thread/post/etc. Code isn't as clear to others as it is to you.
   - Try not to look down on the ignorant. You, of all people, should
   appreciate the complexities of CakePHP.


I must say that I've been guilty of all of the above on some occasion or the
other.

Before you ask/answer a question, try to look at it from the other person's
perspective before you hit the send button.

Question: Why don't we have a rules and regulations text (one the homepage
of the group perhaps?) that states policies on question asking such as
researching, reading, duplicates, etc?

Just my 2 cents
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 11, 2008 4:23 PM, sbeam <[EMAIL PROTECTED]> wrote:

>
> look, thanks for the finger wagging and challenge to a sword fight but
> I'll pass. I did find the thread and the code you linked to a long
> time ago. I rejected it because the comments mentioned MPTT, which
> again I don't need, plus it is totally incomprehensible to me. I tried
> the grigri stuff too but it didn't quite work.
>
> In any case I did also find this which is almost working and is more
> clear:
> http://bin.cakephp.org/saved/21838
>
> I am new to Cake and expected this to be in Bakery, so when it wasn't
> I thought I would ask if there was any progress I was missing, besides
> these heaps of code in pastebin which I didn't understand. Sorry if my
> post disturbed you.
>
> >
>

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



Re: behavior acts_as_list

2008-02-11 Thread AD7six



On Feb 11, 11:23 pm, sbeam <[EMAIL PROTECTED]> wrote:
> look, thanks for the finger wagging and challenge to a sword fight but
> I'll pass. I did find the thread and the code you linked to a long
> time ago.

Ease off champ, it's not a contest. I don't mind what code you use but
it is annoying to get a thread appearing for a topic that was
discussed the same day. At the very least reply to an existing thread
rather than create duplicates.

I can't resist pointing out that I gave you a link to a thread that:
a) was two hours old at the time I gave it to you
b) addresses exactly what you were asking for
c) the code I posted /borrows/ logic from the tree behavior - it's is
not for hierachial data it's for flat lists.

and that your reply /again/ points out that you didn't read it.

Don't worry though I'll remember not to point out the obvious to you
in the future and will rest safe in the knowledge that your powers of
investigation will lead you eventually to the right solution. And then
right past 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: behavior acts_as_list

2008-02-11 Thread sbeam

look, thanks for the finger wagging and challenge to a sword fight but
I'll pass. I did find the thread and the code you linked to a long
time ago. I rejected it because the comments mentioned MPTT, which
again I don't need, plus it is totally incomprehensible to me. I tried
the grigri stuff too but it didn't quite work.

In any case I did also find this which is almost working and is more
clear:
http://bin.cakephp.org/saved/21838

I am new to Cake and expected this to be in Bakery, so when it wasn't
I thought I would ask if there was any progress I was missing, besides
these heaps of code in pastebin which I didn't understand. Sorry if my
post disturbed you.

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



Re: behavior acts_as_list

2008-02-11 Thread AD7six



sbeam wrote:
> On Feb 11, 3:11 pm, AD7six <[EMAIL PROTECTED]> wrote:
> > Please use the search before posting
> >
> > http://groups.google.com/group/cake-php/browse_thread/thread/ed4ae9a2...
>
> As I said I did search, and that didn't suit my needs because it
> seemed like it was suited for MPTT trees or something, I am just
> dealing with a linear list. Thanks for the replay though.

Come on, take it on the chin...

It takes a bit of courage to admit you made a mistake[1] rather than
defend it - Not sure what it takes to make a mistake[2] while trying
to cover up for an early whoopsie ;)

[1] not searching
[2] not reading
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread sbeam

On Feb 11, 3:11 pm, AD7six <[EMAIL PROTECTED]> wrote:
> Please use the search before posting
>
> http://groups.google.com/group/cake-php/browse_thread/thread/ed4ae9a2...

As I said I did search, and that didn't suit my needs because it
seemed like it was suited for MPTT trees or something, I am just
dealing with a linear list. Thanks for the replay though.

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



Re: how images stored in database

2008-02-11 Thread AD7six



On Feb 11, 10:39 am, abiram <[EMAIL PROTECTED]> wrote:
> Hi all i want store images in database actually images stored in
> webroot img folder in database image path is entering it means only
> img names or overall path and how to retrive viewpage like
> 
> and what path is save in database pls send answ

Google is your best buddy

http://www.google.es/search?q=cakephp+store+image+meta+data+in+database
--~--~-~--~~~---~--~~
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: behavior acts_as_list

2008-02-11 Thread AD7six



On Feb 11, 7:54 pm, sbeam <[EMAIL PROTECTED]> wrote:
> hey folks, I need something like acts_as_list in RoR - I found some
> old threads on here where people were mentioning working on it for
> 1.2. So has anyone made any progress on it?
>
> I have a basic version implemented as a method reorder() of my model.
> But I'd like to get a more robust behavior if it is out there. If not,
> I will be glad to contribute if possible
>
> thanks
> Sam

Please use the search before posting

http://groups.google.com/group/cake-php/browse_thread/thread/ed4ae9a2737a0c0d
--~--~-~--~~~---~--~~
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: Indented Select(parent_id)

2008-02-11 Thread AD7six



On Feb 11, 9:30 pm, José Pablo Orozco Marín <[EMAIL PROTECTED]>
wrote:
> Thanks AD7six
>
> Yes, i use it before in another project. But in this case im
> not using tree behavior, this can be done without using
> three behavior, only using find?

See the helper and use/borrow/rob the same logic to add a prefix to
your options.

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



Post data array to html id

2008-02-11 Thread Andreas

Hi

I got a regular post data array in one of my controllers in which I
need to get out the information in the same format as the id in the
html.

For example. I might have an array like this.

array('Page' => array('subject' => 'test'));

The string i need to get out then would be this.
PageSubject

Note that it's always just one field, never more. Any ideas on how to
implement it?

Thanks for all input :)

Andreas
--~--~-~--~~~---~--~~
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 with sessions after changing ip

2008-02-11 Thread rafael bonifaz
On Feb 11, 2008 12:08 PM, rafael bonifaz <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> We have a project where we have a mix of application. Part of the
> application is made with cakephp and the other part is made with poor php.
>
> After changing the ips on the server the non cake php (hosted an
> app/webroot) is loosing the sessions with no reasonable explication. While
> the cake php application works find the external app have problems with the
> sessions.
>
> Has anyone had this problem before? Is there a logical reason on why this
> kind of things can happend?
>

Can this problem be related to some cache functionality in Cake?

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

2008-02-11 Thread Baz
Here's a shameless plug for my site:

http://www.webdevelopment2.com/cakephp-auth-component-tutorial-2/

There's some sample code you can download there and compare certain things.

On Feb 11, 2008 1:21 PM, Chris Hartjes <[EMAIL PROTECTED]> wrote:

>
> On Feb 11, 2008 2:05 PM, Neil <[EMAIL PROTECTED]> wrote:
> >
> > Thanks, but that is not the problem then because in my current setup &
> > for testing I put"
> > var $components = array('Auth');
> > in every controller instead of app_controller and it still did not
> > work.
>
> Dude, I have no idea why it's not working for you.  All the advice
> you've been given is enough to get you going.  Here's a handy
> checklist that I use when doing Auth
>
> 1) Have I included the component everywhere I want
> 2) Have I created the database for the model I'm using for Auth
> 3) Have I created the Model for the database I'm using for Auth
> 4) Have I created my login action and view
> 5) Have I set the correct parameters in my beforeFilter() depending on
> my particular scenario
> 6) I have read over some of these fine sources of documentation on
> using Auth (I happened to have written them):
>
> http://tempdocs.cakephp.org/#TOC14
> http://www.littlehart.net/atthekeyboard/?s=Auth
>
> If you've gone through all that and *still* can't get it to work,
> well, you've fucked something up and need to really debug stuff.  Yes,
> I've made mistakes too despite all the fine info listed above but I
> always figure it out in the end.
>
> --
> 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 "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: Auth Problems

2008-02-11 Thread Chris Hartjes

On Feb 11, 2008 2:05 PM, Neil <[EMAIL PROTECTED]> wrote:
>
> Thanks, but that is not the problem then because in my current setup &
> for testing I put"
> var $components = array('Auth');
> in every controller instead of app_controller and it still did not
> work.

Dude, I have no idea why it's not working for you.  All the advice
you've been given is enough to get you going.  Here's a handy
checklist that I use when doing Auth

1) Have I included the component everywhere I want
2) Have I created the database for the model I'm using for Auth
3) Have I created the Model for the database I'm using for Auth
4) Have I created my login action and view
5) Have I set the correct parameters in my beforeFilter() depending on
my particular scenario
6) I have read over some of these fine sources of documentation on
using Auth (I happened to have written them):

http://tempdocs.cakephp.org/#TOC14
http://www.littlehart.net/atthekeyboard/?s=Auth

If you've gone through all that and *still* can't get it to work,
well, you've fucked something up and need to really debug stuff.  Yes,
I've made mistakes too despite all the fine info listed above but I
always figure it out in the end.

-- 
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 "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 1.2 Baking Question

2008-02-11 Thread rob.rightmyer

Yes, I am baking the views from the app_name folder at the command
prompt.

I have also setup Eclipse PDT and can bake directly from there but
with the same results.

Could it be something incorrect in my setup?

On Feb 11, 12:40 pm, Baz <[EMAIL PROTECTED]> wrote:
> hmmph,
>
> Never experienced what you're seeing. Are you sure you're baking the views
> from the app_name folder?
>
> On Feb 11, 2008 12:36 PM, rob.rightmyer <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Is the problem with the actual FOLDER structure or is it a URL problem
> > (or
> > > both)?
>
> > The problem seems to be with the folder structure created after baking
> > which
> > in turn effects the URL when I try to access my app.
>
> > > Ok, here we go, start fresh!
>
> > >1. cd htdocs\cake
> > >2. cake bake [newapp]
> > >3. cd newapp
> > >4. cake bake (bake stuff from here)
>
> > Followed these steps and experienced the same results unfortunately.
>
> > The resulting directory structure after baking looks like this:
> > htdocs\cake\app_name\views\app_name
>
> > And inside this directory are add.ctp, edit.ctp, index.ctp and
> > view.ctp.
>
> > To accesshttp://localhost/cake/newappwould require the files above
> > to
> > be in the root of my view folder, correct? Or am I missing something?
> > If I
> > move the files up a level to the "view" directory, this should give me
> > the
> > result I'm looking for. Instead I receive the standard cake "home"
> > page.
>
> > The functionality I'm hoping to achieve is to be able to install cake
> > on any
> > directory on my server, which is one of the main features mentioned on
> > the
> > CakePHP page. If there is a better way to accomplish this I'd like to
> > know.
>
> > On Feb 11, 11:25 am, Baz <[EMAIL PROTECTED]> wrote:
> > > Ok, we need to make a distinction here...
>
> > > Is the problem with the actual FOLDER structure or is it a URL problem
> > (or
> > > both)?
>
> > > Ok, here we go, start fresh!
>
> > >1. cd htdocs\cake
> > >2. cake bake [newapp]
> > >3. cd newapp
> > >4. cake bake (bake stuff from here)
>
> > > You should be able to access fromhttp://localhost/cake/newapp
>
> > > If not, check your DocumentRoot in httd.conf.
>
> > > or better yet, just copy the default app folder to newapp and see if it
> > does
> > > the same doubling thing.
>
> > > On Feb 11, 2008 10:26 AM, rright <[EMAIL PROTECTED]> wrote:
>
> > > > > Questions:
> > > > > - Linux/Windows
> > > > > - PHP and Cake console in %PATH% or calling each time?
>
> > > > I'm running xampp on Windows and Cake is installed in the xampp htdocs
> > > > folder:
> > > > "localhost://cake"
>
> > > > PHP and Cake console have been added to the Path environment variables
> > > > in Windows.
>
> > > > I want to clarify that baking works fine but my question is in the
> > > > resulting paths to my app.
>
> > > > After baking, the resulting path to my app is:
> > > >http://localhost/cake/project_name/project_name/
>
> > > > I want to know how to make my app accessible from this URL insteak:
> > > >http://localhost/cake/project_name/
>
> > > > Baking appears to double my project name twice in the URL string.
> > > > Perhaps this is by
> > > > design, I don't know. I'm a cake newbie and am just trying to
> > > > understand if what I'm
> > > > seeing is normal or if there is an adjustment I need to make to
> > > > achieve what I want.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



TInyMCE 3.0 + Cake..

2008-02-11 Thread Mech7

Hi i am loading TinyMCE 3 and it works great.. only when i load some
extra plugins cake sees them as controllers, and it will throw up
errors like:

JsController could not be found.
50
51 Error: 
52 Create the class JsController below in file: app/
controllers/js_controller.php
53
54
60

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



Re: Auth Problems

2008-02-11 Thread Neil

Thanks, but that is not the problem then because in my current setup &
for testing I put"
var $components = array('Auth');
in every controller instead of app_controller and it still did not
work.

On Feb 11, 2:01 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Feb 11, 2008 1:59 PM, Neil <[EMAIL PROTECTED]> wrote:
>
>
>
> > thanks for the quick reply.
>
> > what does:  parrent::beforeFilter();  do?
>
> > thanks!
>
> It executes anything that is in the beforeFilter() method of the parent class.
>
> --
> 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 "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: Auth Problems

2008-02-11 Thread Chris Hartjes

On Feb 11, 2008 1:59 PM, Neil <[EMAIL PROTECTED]> wrote:
>
> thanks for the quick reply.
>
> what does:  parrent::beforeFilter();  do?
>
> thanks!

It executes anything that is in the beforeFilter() method of the parent class.

-- 
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 "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: Auth Problems

2008-02-11 Thread Neil

thanks for the quick reply.

what does:  parrent::beforeFilter();  do?

thanks!

On Feb 11, 1:42 pm, Baz <[EMAIL PROTECTED]> wrote:
> In your controllers, shouldn't you have:
>
> function beforeFilter()
>{
>parrent::beforeFilter();
>$this->Auth->allow('action1', 'action2', ect..);
>}
>
> 
>
> On Feb 11, 2008 12:38 PM, Neil <[EMAIL PROTECTED]> wrote:
>
>
>
> > I still can't get this to work:
>
> > I have added this to my app controler:
> > var $components = array('Auth');
>
> > and then to all my other controllers where I want to allow access to
> > certain cations I did:
> > function beforeFilter()
> >{
> >$this->Auth->allow('action1', 'action2', ect..);
> >}
>
> > It appears to work when I first set it up but then if I check back
> > 1-2hrs later nothing work and I get the error I shared with you in my
> > last reply.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



behavior acts_as_list

2008-02-11 Thread sbeam

hey folks, I need something like acts_as_list in RoR - I found some
old threads on here where people were mentioning working on it for
1.2. So has anyone made any progress on it?

I have a basic version implemented as a method reorder() of my model.
But I'd like to get a more robust behavior if it is out there. If not,
I will be glad to contribute if possible

thanks
Sam

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



Re: Auth Problems

2008-02-11 Thread Baz
In your controllers, shouldn't you have:

function beforeFilter()
   {
   parrent::beforeFilter();
   $this->Auth->allow('action1', 'action2', ect..);
   }




On Feb 11, 2008 12:38 PM, Neil <[EMAIL PROTECTED]> wrote:

>
> I still can't get this to work:
>
> I have added this to my app controler:
> var $components = array('Auth');
>
> and then to all my other controllers where I want to allow access to
> certain cations I did:
> function beforeFilter()
>{
>$this->Auth->allow('action1', 'action2', ect..);
>}
>
> It appears to work when I first set it up but then if I check back
> 1-2hrs later nothing work and I get the error I shared with you in my
> last reply.
> >
>

--~--~-~--~~~---~--~~
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: more fields in list function

2008-02-11 Thread nate

Hey Baz.  Until we have proper docs, the best place to look is the
test cases.  The Set class has some pretty good usage examples there.


>
>
> > > '{n}.User.surname.0'  ???
>
> > > Why the .0 at the end?
>
> > To get the first letter. Strings are treated as arrays and can be
> > indexed, so if $var = "Hello" then $var[0] = "H";
>
> > Correction to what I said above: using format arrays only works for
> > keyPath and valuePath, NOT for groupPath (hence the workaround using .
> > 0)
>
> > Maybe this will be added at a later date?
>
> > On Feb 11, 5:15 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > EXTREMELY NEAT!! (please excuse my excitement :D )
>
> > > Just one thing in the complicated example
>
> > > '{n}.User.surname.0'  ???
>
> > > Why the .0 at the end?
> > > --
> > > Baz L
> > > Web Development 2.0http://WebDevelopment2.com/
>
> > > On Feb 11, 2008 11:10 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > > grigri, can you write up some of this and send to John for the
> > > > documentation project, this has got to get in there.
>
> > > > Sam D
>
> > > > On Feb 11, 2008 10:06 AM, grigri <[EMAIL PROTECTED]> wrote:
>
> > > > > It's easy, really - for each of the 3 fields (keyPath, valuePath and
> > > > > groupPath), instead of passing a string, you can pass an array.
>
> > > > > The first entry in the array is the format string, the rest are the
> > > > > parameters (extracted with Set::extract()).
>
> > > > > The format is exactly the same as sprintf() [it calls vsprintf()
> > > > > internally].
>
> > > > > So, passing array('%s %s', '{n}.Person.firstname',
> > > > > '{n}.Person.surname') as the valuePath does the following:
>
> > > > > * realizes it's an array, not a string
> > > > > * grabs the first entry ('%s %s') for the format, remembers the rest
> > > > > as parameters
> > > > > * for each parameter, calls Set::extract($data, ...) :
> > > > >     + Set::extract($data, '{n}.Person.firstname');
> > > > >     + Set::extract($data, '{n}.Person.last');
> > > > > * calls vsprintf($format, $parameters)
>
> > > > > You can also use "{1} {2}" as the format string instead of the
> > > > > sprintf() format, if you like. Personally I prefer the sprintf
> > format,
> > > > > because I'm more used to it. Plus you can do things like padding,
> > > > > truncating and whatnot:
>
> > > > > Slightly more complicated example:
>
> > > > > $data = array(
> > > > >   array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname'
> > =>
> > > > > 'Bloggs')),
> > > > >   array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname'
> > =>
> > > > > 'Bloggs')),
> > > > >   array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname'
> > =>
> > > > > 'Beam')),
> > > > >   array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname'
> > =>
> > > > > 'Daniels')),
> > > > > );
>
> > > > > debug(Set::combine(
> > > > >   $data,
> > > > >   '{n}.User.id',
> > > > >   array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
> > > > >   '{n}.User.surname.0'
> > > > > ));
>
> > > > > result:
> > > > > Array
> > > > > (
> > > > >     [B] => Array
> > > > >         (
> > > > >             [1] => Bloggs, J.
> > > > >             [2] => Bloggs, F.
> > > > >             [3] => Beam, J.
> > > > >         )
>
> > > > >     [D] => Array
> > > > >         (
> > > > >             [4] => Daniels, J.
> > > > >         )
>
> > > > > )
>
> > > > > neat, no?
>
> > > > > On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > > > > Yeah, I've seen that a lot.
>
> > > > > > What I was referring to with grigri's example is that :
>
> > > > > > array(%s %s %s) thing for the path...
>
> > > > > > I have tons of examples like these where I need to do a
> > "$firstname -
> > > > > > $lastname" type of thing.
>
> > > > > > On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > > > > > there is the start of some information on Set:: at
>
> > > >http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-.
> > ..
>
> > > > > > > Sam D
>
> > > > > > > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > > > > > > Are you serious?
>
> > > > > > > > Ok, you guys need a Set::combine tutorial or something!
>
> > > > > > > > I've been trying to figure this out how to combine fields for
> > a
> > > > few
> > > > > > > months
> > > > > > > > now. I've been reduced to creating a custom array in a foreach
> > > > loop.
>
> > > > > > > > But I knew, deep down inside, there must be way.  ThanX
> > > > > > > > --
> > > > > > > > Baz L
> > > > > > > > Web Development 2.0
> > > > > > > >http://WebDevelopment2.com/
>
> > > > > > > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > It works, thank you very much!
> > > > > > > > > Now i'm gonna try to make a function to combine the two
> > > > functions :)
>
> > > > > > > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]>
> > wrote:
> > > > > > > > > > find('list') only works with simple fields, you won't be
> > able
> > > > t

Re: Cake 1.2 Baking Question

2008-02-11 Thread Baz
hmmph,

Never experienced what you're seeing. Are you sure you're baking the views
from the app_name folder?

On Feb 11, 2008 12:36 PM, rob.rightmyer <[EMAIL PROTECTED]> wrote:

>
> > Is the problem with the actual FOLDER structure or is it a URL problem
> (or
> > both)?
>
> The problem seems to be with the folder structure created after baking
> which
> in turn effects the URL when I try to access my app.
>
> > Ok, here we go, start fresh!
> >
> >1. cd htdocs\cake
> >2. cake bake [newapp]
> >3. cd newapp
> >4. cake bake (bake stuff from here)
>
> Followed these steps and experienced the same results unfortunately.
>
> The resulting directory structure after baking looks like this:
> htdocs\cake\app_name\views\app_name
>
> And inside this directory are add.ctp, edit.ctp, index.ctp and
> view.ctp.
>
> To access http://localhost/cake/newapp would require the files above
> to
> be in the root of my view folder, correct? Or am I missing something?
> If I
> move the files up a level to the "view" directory, this should give me
> the
> result I'm looking for. Instead I receive the standard cake "home"
> page.
>
> The functionality I'm hoping to achieve is to be able to install cake
> on any
> directory on my server, which is one of the main features mentioned on
> the
> CakePHP page. If there is a better way to accomplish this I'd like to
> know.
>
> On Feb 11, 11:25 am, Baz <[EMAIL PROTECTED]> wrote:
> > Ok, we need to make a distinction here...
> >
> > Is the problem with the actual FOLDER structure or is it a URL problem
> (or
> > both)?
> >
> > Ok, here we go, start fresh!
> >
> >1. cd htdocs\cake
> >2. cake bake [newapp]
> >3. cd newapp
> >4. cake bake (bake stuff from here)
> >
> > You should be able to access fromhttp://localhost/cake/newapp
> >
> > If not, check your DocumentRoot in httd.conf.
> >
> > or better yet, just copy the default app folder to newapp and see if it
> does
> > the same doubling thing.
> >
> > On Feb 11, 2008 10:26 AM, rright <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > > Questions:
> > > > - Linux/Windows
> > > > - PHP and Cake console in %PATH% or calling each time?
> >
> > > I'm running xampp on Windows and Cake is installed in the xampp htdocs
> > > folder:
> > > "localhost://cake"
> >
> > > PHP and Cake console have been added to the Path environment variables
> > > in Windows.
> >
> > > I want to clarify that baking works fine but my question is in the
> > > resulting paths to my app.
> >
> > > After baking, the resulting path to my app is:
> > >http://localhost/cake/project_name/project_name/
> >
> > > I want to know how to make my app accessible from this URL insteak:
> > >http://localhost/cake/project_name/
> >
> > > Baking appears to double my project name twice in the URL string.
> > > Perhaps this is by
> > > design, I don't know. I'm a cake newbie and am just trying to
> > > understand if what I'm
> > > seeing is normal or if there is an adjustment I need to make to
> > > achieve what I want.
> >
>

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

2008-02-11 Thread Neil

I still can't get this to work:

I have added this to my app controler:
var $components = array('Auth');

and then to all my other controllers where I want to allow access to
certain cations I did:
function beforeFilter()
{
$this->Auth->allow('action1', 'action2', ect..);
}

It appears to work when I first set it up but then if I check back
1-2hrs later nothing work and I get the error I shared with you in my
last reply.
--~--~-~--~~~---~--~~
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 1.2 Baking Question

2008-02-11 Thread rob.rightmyer

> Is the problem with the actual FOLDER structure or is it a URL problem (or
> both)?

The problem seems to be with the folder structure created after baking
which
in turn effects the URL when I try to access my app.

> Ok, here we go, start fresh!
>
>1. cd htdocs\cake
>2. cake bake [newapp]
>3. cd newapp
>4. cake bake (bake stuff from here)

Followed these steps and experienced the same results unfortunately.

The resulting directory structure after baking looks like this:
htdocs\cake\app_name\views\app_name

And inside this directory are add.ctp, edit.ctp, index.ctp and
view.ctp.

To access http://localhost/cake/newapp would require the files above
to
be in the root of my view folder, correct? Or am I missing something?
If I
move the files up a level to the "view" directory, this should give me
the
result I'm looking for. Instead I receive the standard cake "home"
page.

The functionality I'm hoping to achieve is to be able to install cake
on any
directory on my server, which is one of the main features mentioned on
the
CakePHP page. If there is a better way to accomplish this I'd like to
know.

On Feb 11, 11:25 am, Baz <[EMAIL PROTECTED]> wrote:
> Ok, we need to make a distinction here...
>
> Is the problem with the actual FOLDER structure or is it a URL problem (or
> both)?
>
> Ok, here we go, start fresh!
>
>1. cd htdocs\cake
>2. cake bake [newapp]
>3. cd newapp
>4. cake bake (bake stuff from here)
>
> You should be able to access fromhttp://localhost/cake/newapp
>
> If not, check your DocumentRoot in httd.conf.
>
> or better yet, just copy the default app folder to newapp and see if it does
> the same doubling thing.
>
> On Feb 11, 2008 10:26 AM, rright <[EMAIL PROTECTED]> wrote:
>
>
>
> > > Questions:
> > > - Linux/Windows
> > > - PHP and Cake console in %PATH% or calling each time?
>
> > I'm running xampp on Windows and Cake is installed in the xampp htdocs
> > folder:
> > "localhost://cake"
>
> > PHP and Cake console have been added to the Path environment variables
> > in Windows.
>
> > I want to clarify that baking works fine but my question is in the
> > resulting paths to my app.
>
> > After baking, the resulting path to my app is:
> >http://localhost/cake/project_name/project_name/
>
> > I want to know how to make my app accessible from this URL insteak:
> >http://localhost/cake/project_name/
>
> > Baking appears to double my project name twice in the URL string.
> > Perhaps this is by
> > design, I don't know. I'm a cake newbie and am just trying to
> > understand if what I'm
> > seeing is normal or if there is an adjustment I need to make to
> > achieve what I want.
--~--~-~--~~~---~--~~
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: Indented Select(parent_id)

2008-02-11 Thread José Pablo Orozco Marín

Thanks AD7six

Yes, i use it before in another project. But in this case im
not using tree behavior, this can be done without using
three behavior, only using find?


Thnaks.
> See generateTreeList in 1.2 (and it's db requirements) or "DIY". The
> logic/code shown here might also be useful: 
> http://bakery.cakephp.org/articles/view/tree-helper-1
>
>   


--~--~-~--~~~---~--~~
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: Input form helper 'empty' => true not work

2008-02-11 Thread Baz
I've always just done an unset($this->data['Model']['password']) in my
controller.

On Jan 31, 2008 7:26 AM, Siebren Bakker <[EMAIL PROTECTED]> wrote:

> Yeah, the docs don't match up anymore. I had the 'empty' => true flag set
> up in my signup form too, and it doesn't work either...Thanks for the
> workaround to that!
>
> On Jan 30, 2008 5:29 AM, Reny <[EMAIL PROTECTED]> wrote:
>
> >
> > On 30 Gen, 12:15, grigri <[EMAIL PROTECTED]> wrote:
> >  You're right - hadn't noticed that! I apologise for the condescending
> > > tone of my message, I feel like quite a tit now.
> > Don't worry, no problem :)
> >
> > > I wonder if the docs are ahead of the code or vice-versa?
> > I don't know, I know only that don't work :), the possibility are the
> > code is not aligned with docs and vice-versa or there is a bug.
> >
> > Now, I implemented the workaround that ad7six suggested.
> >
> > Version: 3.12
> > GCS d- s+: a19 C UL++ P L++
> > !E W++ N(-) o? K? w(+) O? M-- V?
> > PS+ PE Y- PGP- t+ 5? X- R tv--
> > b++ Di D+ G+ e h! r y-
> > --END GEEK CODE BLOCK--
> > > >
> >

--~--~-~--~~~---~--~~
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: Has anyone integrated the fckeditor with the 1.2 version of CakePHP?

2008-02-11 Thread Baz
I just used the lazy way and replaced all textareas instead of trying to
determine specific IDs through a helper.

I just restrict my usage to putting one text area on the form when I need to
include the FCKEditor.

On Feb 4, 2008 11:12 AM, Carl <[EMAIL PROTECTED]> wrote:

>
> ...and of course I tried all the versions listed in the comments, but
> all I get is the textarea, not the editor.
>
> On Feb 4, 8:33 am, Carl <[EMAIL PROTECTED]> wrote:
> > Thanks, I tried that, but I get this:
> >
> > Warning (512): Method FormHelper::labelTag does not exist [CORE\cake
> > \libs\view\helper.php, line 148]
> > Notice (1024): Method textarea() is deprecated in HtmlHelper: see
> > FormHelper::input or FormHelper::textarea [CORE\cake\libs\view\helpers
> > \html.php, line 659]
> > Notice (8): Undefined variable: did [APP\views\helpers\fck.php, line
> > 6]
> > Notice (1024): Method tagErrorMsg() is deprecated in HtmlHelper: see
> > FormHelper::error [CORE\cake\libs\view\helpers\html.php, line 801]
> >
> > which is why I asked about 1.2.
> >
> > On Feb 4, 8:03 am, "[EMAIL PROTECTED]"
> >
> > <[EMAIL PROTECTED]> wrote:
> > > Lots of people!
> >
> > >http://bakery.cakephp.org/articles/view/using-fckeditor-with-cakephp
> >
> > > works fine for 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: using php-cli with cake

2008-02-11 Thread Chowsapal

Here's one example of how to do that:
http://filchiprogrammer.wordpress.com/2008/01/08/how-to-call-a-controlleraction-in-crontab/

These examples are for cron jobs, but it works for regular CLI calls
as well.

There are a couple different cron_dispatcher variations floating
around if you google for that.


On Feb 11, 11:48 am, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Hello All,
>
> I had a php script which i used to execute in background. This script was
> called from some other php script. I used following to execute the script in
> background:
>
> $backscript = "test.php";
>
> exec("$path_to_php $backscript params> /dev/null &");// (>/dev/null & part
> is what sends to background)
>
> Now i have turned this background script into an action of the controller
> but still want to execute it in background. I am trying it as follows:
>
> $backscript = "mycontroller/action";
> exec("$path_to_php $backscript params> /dev/null &");// (>/dev/null & part
> is what sends to background)
>
> but with no success. Any help or pointers on doing this in cake will be
> highly appreciated.
>
> --
> Thanks & Regards,
> Novice (http://ishuonweb.wordpress.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: Problems with Cake 1.2 form helper storing dates in associative array

2008-02-11 Thread Baz
Cool, looks like a bug to me.

The form helper has been revamped when dealing with dates. I've never tested
with a field that has an underscore. That seems to be the root of the
problem.

On Feb 10, 2008 4:44 AM, DlEast <[EMAIL PROTECTED]> wrote:

>
> Hello!
>
> I have had a site running the pre-beta of cake 1.2 and decided to make
> the change to beta 1.2. Everything works great with exception for my
> dates. I use the form helper to generate input fields.
>
> My current setup looks like this:
> SQL:
>  `start_year` int(4) NOT NULL default '0',
>  `end_year` int(4) default NULL,
>  `start_month` int(2) NOT NULL default '0',
>  `end_month` int(2) default NULL,
> View:
> year('Cv_education.start', null, null, null,
> array('tabindex' => "16")); ?>
> month('Cv_education.start', null, array('tabindex'
> => "18")); ?>
> year('Cv_education.end', null, null, null,
> array('tabindex' => "20")); ?>
> month('Cv_education.end', null, array('tabindex' =>
> "22")); ?>
>
> Previously cake saved the data as $this->data['Cv']['start_year'] but
> with the new version the data is saved as $this->data['Cv']['start']
> ['year'].
>
> This causes saving and loading issues. I have looked around on various
> pages and have only found the information that cakephp 1.2 beta is
> supposed to concatenated the array in to a single field but this isn't
> happening.
>
> Any help on how to get my site running again would be appreciated.
>
> // Daniel
>
> >
>

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



Re: more fields in list function

2008-02-11 Thread Baz
Ohh,

I didn't even notice the grouping by letters. Extremely cool...nice.

On Feb 11, 2008 11:17 AM, grigri <[EMAIL PROTECTED]> wrote:

>
> > '{n}.User.surname.0'  ???
> >
> > Why the .0 at the end?
>
> To get the first letter. Strings are treated as arrays and can be
> indexed, so if $var = "Hello" then $var[0] = "H";
>
> Correction to what I said above: using format arrays only works for
> keyPath and valuePath, NOT for groupPath (hence the workaround using .
> 0)
>
> Maybe this will be added at a later date?
>
> On Feb 11, 5:15 pm, Baz <[EMAIL PROTECTED]> wrote:
> > EXTREMELY NEAT!! (please excuse my excitement :D )
> >
> > Just one thing in the complicated example
> >
> > '{n}.User.surname.0'  ???
> >
> > Why the .0 at the end?
> > --
> > Baz L
> > Web Development 2.0http://WebDevelopment2.com/
> >
> > On Feb 11, 2008 11:10 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > grigri, can you write up some of this and send to John for the
> > > documentation project, this has got to get in there.
> >
> > > Sam D
> >
> > > On Feb 11, 2008 10:06 AM, grigri <[EMAIL PROTECTED]> wrote:
> >
> > > > It's easy, really - for each of the 3 fields (keyPath, valuePath and
> > > > groupPath), instead of passing a string, you can pass an array.
> >
> > > > The first entry in the array is the format string, the rest are the
> > > > parameters (extracted with Set::extract()).
> >
> > > > The format is exactly the same as sprintf() [it calls vsprintf()
> > > > internally].
> >
> > > > So, passing array('%s %s', '{n}.Person.firstname',
> > > > '{n}.Person.surname') as the valuePath does the following:
> >
> > > > * realizes it's an array, not a string
> > > > * grabs the first entry ('%s %s') for the format, remembers the rest
> > > > as parameters
> > > > * for each parameter, calls Set::extract($data, ...) :
> > > > + Set::extract($data, '{n}.Person.firstname');
> > > > + Set::extract($data, '{n}.Person.last');
> > > > * calls vsprintf($format, $parameters)
> >
> > > > You can also use "{1} {2}" as the format string instead of the
> > > > sprintf() format, if you like. Personally I prefer the sprintf
> format,
> > > > because I'm more used to it. Plus you can do things like padding,
> > > > truncating and whatnot:
> >
> > > > Slightly more complicated example:
> >
> > > > $data = array(
> > > >   array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname'
> =>
> > > > 'Bloggs')),
> > > >   array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname'
> =>
> > > > 'Bloggs')),
> > > >   array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname'
> =>
> > > > 'Beam')),
> > > >   array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname'
> =>
> > > > 'Daniels')),
> > > > );
> >
> > > > debug(Set::combine(
> > > >   $data,
> > > >   '{n}.User.id',
> > > >   array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
> > > >   '{n}.User.surname.0'
> > > > ));
> >
> > > > result:
> > > > Array
> > > > (
> > > > [B] => Array
> > > > (
> > > > [1] => Bloggs, J.
> > > > [2] => Bloggs, F.
> > > > [3] => Beam, J.
> > > > )
> >
> > > > [D] => Array
> > > > (
> > > > [4] => Daniels, J.
> > > > )
> >
> > > > )
> >
> > > > neat, no?
> >
> > > > On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > > > Yeah, I've seen that a lot.
> >
> > > > > What I was referring to with grigri's example is that :
> >
> > > > > array(%s %s %s) thing for the path...
> >
> > > > > I have tons of examples like these where I need to do a
> "$firstname -
> > > > > $lastname" type of thing.
> >
> > > > > On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> >
> > > > > > there is the start of some information on Set:: at
> >
> > >http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-.
> ..
> >
> > > > > > Sam D
> >
> > > > > > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > > > > > Are you serious?
> >
> > > > > > > Ok, you guys need a Set::combine tutorial or something!
> >
> > > > > > > I've been trying to figure this out how to combine fields for
> a
> > > few
> > > > > > months
> > > > > > > now. I've been reduced to creating a custom array in a foreach
> > > loop.
> >
> > > > > > > But I knew, deep down inside, there must be way.  ThanX
> > > > > > > --
> > > > > > > Baz L
> > > > > > > Web Development 2.0
> > > > > > >http://WebDevelopment2.com/
> >
> > > > > > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > > It works, thank you very much!
> > > > > > > > Now i'm gonna try to make a function to combine the two
> > > functions :)
> >
> > > > > > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]>
> wrote:
> > > > > > > > > find('list') only works with simple fields, you won't be
> able
> > > to do
> > > > > > > > > this.
> >
> > > > > > > > > Still, it's easy enough with find('all') and
> Set::combine():
> >
> > > > > > > > > $people =

Re: Cake 1.2 Baking Question

2008-02-11 Thread Baz
Ok, we need to make a distinction here...

Is the problem with the actual FOLDER structure or is it a URL problem (or
both)?

Ok, here we go, start fresh!

   1. cd htdocs\cake
   2. cake bake [newapp]
   3. cd newapp
   4. cake bake (bake stuff from here)

You should be able to access from http://localhost/cake/newapp

If not, check your DocumentRoot in httd.conf.

or better yet, just copy the default app folder to newapp and see if it does
the same doubling thing.

On Feb 11, 2008 10:26 AM, rright <[EMAIL PROTECTED]> wrote:

>
> > Questions:
> > - Linux/Windows
> > - PHP and Cake console in %PATH% or calling each time?
>
> I'm running xampp on Windows and Cake is installed in the xampp htdocs
> folder:
> "localhost://cake"
>
> PHP and Cake console have been added to the Path environment variables
> in Windows.
>
> I want to clarify that baking works fine but my question is in the
> resulting paths to my app.
>
> After baking, the resulting path to my app is:
> http://localhost/cake/project_name/project_name/
>
> I want to know how to make my app accessible from this URL insteak:
> http://localhost/cake/project_name/
>
> Baking appears to double my project name twice in the URL string.
> Perhaps this is by
> design, I don't know. I'm a cake newbie and am just trying to
> understand if what I'm
> seeing is normal or if there is an adjustment I need to make to
> achieve what I want.
> >
>

--~--~-~--~~~---~--~~
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 sessions after changing ip

2008-02-11 Thread rafael bonifaz
Hi all,

We have a project where we have a mix of application. Part of the
application is made with cakephp and the other part is made with poor php.

After changing the ips on the server the non cake php (hosted an
app/webroot) is loosing the sessions with no reasonable explication. While
the cake php application works find the external app have problems with the
sessions.

Has anyone had this problem before? Is there a logical reason on why this
kind of things can happend?

Greetings,

Rafael

--~--~-~--~~~---~--~~
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-11 Thread Renan Gonçalves
Hiho!

Eclipse PDT has many configurations options.
You can do anything what you wanna. Take a look at PHP > Editor (inside of
Window > Preferences)

You can inactivate the validation in Window > Preferences > Validation.

Only I see no need to create the header and footer files. You can create a
file with the two and only put the content_for_layout


[]'s

On Feb 11, 2008 2:29 PM, José Pablo Orozco Marín <[EMAIL PROTECTED]> wrote:

>
> http://www.aptana.com/studio/
>
> http://www.evrsoft.com/1stpage2_features.shtml
>
> http://tswebeditor.net.tc/
>
> http://devphp.sourceforge.net/
>
> http://www.zeusedit.com/php.html
>
>
>
> >
>


-- 
Renan Gonçalves - Software Engineer
Cell Phone: +55 (11) 8633-6018
MSN: [EMAIL PROTECTED]
Web Site: renangoncalves.com
São Paulo - SP/Brazil

--~--~-~--~~~---~--~~
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: more fields in list function

2008-02-11 Thread grigri

> '{n}.User.surname.0'  ???
>
> Why the .0 at the end?

To get the first letter. Strings are treated as arrays and can be
indexed, so if $var = "Hello" then $var[0] = "H";

Correction to what I said above: using format arrays only works for
keyPath and valuePath, NOT for groupPath (hence the workaround using .
0)

Maybe this will be added at a later date?

On Feb 11, 5:15 pm, Baz <[EMAIL PROTECTED]> wrote:
> EXTREMELY NEAT!! (please excuse my excitement :D )
>
> Just one thing in the complicated example
>
> '{n}.User.surname.0'  ???
>
> Why the .0 at the end?
> --
> Baz L
> Web Development 2.0http://WebDevelopment2.com/
>
> On Feb 11, 2008 11:10 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
>
> > grigri, can you write up some of this and send to John for the
> > documentation project, this has got to get in there.
>
> > Sam D
>
> > On Feb 11, 2008 10:06 AM, grigri <[EMAIL PROTECTED]> wrote:
>
> > > It's easy, really - for each of the 3 fields (keyPath, valuePath and
> > > groupPath), instead of passing a string, you can pass an array.
>
> > > The first entry in the array is the format string, the rest are the
> > > parameters (extracted with Set::extract()).
>
> > > The format is exactly the same as sprintf() [it calls vsprintf()
> > > internally].
>
> > > So, passing array('%s %s', '{n}.Person.firstname',
> > > '{n}.Person.surname') as the valuePath does the following:
>
> > > * realizes it's an array, not a string
> > > * grabs the first entry ('%s %s') for the format, remembers the rest
> > > as parameters
> > > * for each parameter, calls Set::extract($data, ...) :
> > > + Set::extract($data, '{n}.Person.firstname');
> > > + Set::extract($data, '{n}.Person.last');
> > > * calls vsprintf($format, $parameters)
>
> > > You can also use "{1} {2}" as the format string instead of the
> > > sprintf() format, if you like. Personally I prefer the sprintf format,
> > > because I'm more used to it. Plus you can do things like padding,
> > > truncating and whatnot:
>
> > > Slightly more complicated example:
>
> > > $data = array(
> > >   array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname' =>
> > > 'Bloggs')),
> > >   array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname' =>
> > > 'Bloggs')),
> > >   array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname' =>
> > > 'Beam')),
> > >   array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname' =>
> > > 'Daniels')),
> > > );
>
> > > debug(Set::combine(
> > >   $data,
> > >   '{n}.User.id',
> > >   array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
> > >   '{n}.User.surname.0'
> > > ));
>
> > > result:
> > > Array
> > > (
> > > [B] => Array
> > > (
> > > [1] => Bloggs, J.
> > > [2] => Bloggs, F.
> > > [3] => Beam, J.
> > > )
>
> > > [D] => Array
> > > (
> > > [4] => Daniels, J.
> > > )
>
> > > )
>
> > > neat, no?
>
> > > On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > > Yeah, I've seen that a lot.
>
> > > > What I was referring to with grigri's example is that :
>
> > > > array(%s %s %s) thing for the path...
>
> > > > I have tons of examples like these where I need to do a "$firstname -
> > > > $lastname" type of thing.
>
> > > > On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > > > there is the start of some information on Set:: at
>
> >http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-...
>
> > > > > Sam D
>
> > > > > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > > > > Are you serious?
>
> > > > > > Ok, you guys need a Set::combine tutorial or something!
>
> > > > > > I've been trying to figure this out how to combine fields for a
> > few
> > > > > months
> > > > > > now. I've been reduced to creating a custom array in a foreach
> > loop.
>
> > > > > > But I knew, deep down inside, there must be way.  ThanX
> > > > > > --
> > > > > > Baz L
> > > > > > Web Development 2.0
> > > > > >http://WebDevelopment2.com/
>
> > > > > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
>
> > > > > > > It works, thank you very much!
> > > > > > > Now i'm gonna try to make a function to combine the two
> > functions :)
>
> > > > > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > > > > > > find('list') only works with simple fields, you won't be able
> > to do
> > > > > > > > this.
>
> > > > > > > > Still, it's easy enough with find('all') and Set::combine():
>
> > > > > > > > $people = $this->Person->find('all', array(
> > > > > > > >   'fields' => array('id', 'firstname', 'insertion',
> > 'surname'),
> > > > > > > >   'recursive' => -1
> > > > > > > > ));
> > > > > > > > $list = Set::combine(
> > > > > > > >   $people,
> > > > > > > >   '{n}.Person.id',
> > > > > > > >   array('%s %s %s', '{n}.Person.firstname',
> > '{n}.Person.insertion',
> > > > > > > > '{n}.Person.surname')
> > > > > > > > );
>
> > > > > > > > On Feb 11, 9:25 am, r

Re: more fields in list function

2008-02-11 Thread Baz
EXTREMELY NEAT!! (please excuse my excitement :D )

Just one thing in the complicated example

'{n}.User.surname.0'  ???

Why the .0 at the end?
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 11, 2008 11:10 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:

>
> grigri, can you write up some of this and send to John for the
> documentation project, this has got to get in there.
>
> Sam D
>
> On Feb 11, 2008 10:06 AM, grigri <[EMAIL PROTECTED]> wrote:
> >
> > It's easy, really - for each of the 3 fields (keyPath, valuePath and
> > groupPath), instead of passing a string, you can pass an array.
> >
> > The first entry in the array is the format string, the rest are the
> > parameters (extracted with Set::extract()).
> >
> > The format is exactly the same as sprintf() [it calls vsprintf()
> > internally].
> >
> > So, passing array('%s %s', '{n}.Person.firstname',
> > '{n}.Person.surname') as the valuePath does the following:
> >
> > * realizes it's an array, not a string
> > * grabs the first entry ('%s %s') for the format, remembers the rest
> > as parameters
> > * for each parameter, calls Set::extract($data, ...) :
> > + Set::extract($data, '{n}.Person.firstname');
> > + Set::extract($data, '{n}.Person.last');
> > * calls vsprintf($format, $parameters)
> >
> > You can also use "{1} {2}" as the format string instead of the
> > sprintf() format, if you like. Personally I prefer the sprintf format,
> > because I'm more used to it. Plus you can do things like padding,
> > truncating and whatnot:
> >
> > Slightly more complicated example:
> >
> > $data = array(
> >   array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname' =>
> > 'Bloggs')),
> >   array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname' =>
> > 'Bloggs')),
> >   array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname' =>
> > 'Beam')),
> >   array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname' =>
> > 'Daniels')),
> > );
> >
> > debug(Set::combine(
> >   $data,
> >   '{n}.User.id',
> >   array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
> >   '{n}.User.surname.0'
> > ));
> >
> > result:
> > Array
> > (
> > [B] => Array
> > (
> > [1] => Bloggs, J.
> > [2] => Bloggs, F.
> > [3] => Beam, J.
> > )
> >
> > [D] => Array
> > (
> > [4] => Daniels, J.
> > )
> >
> > )
> >
> > neat, no?
> >
> >
> > On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> > > Yeah, I've seen that a lot.
> > >
> > > What I was referring to with grigri's example is that :
> > >
> > > array(%s %s %s) thing for the path...
> > >
> > > I have tons of examples like these where I need to do a "$firstname -
> > > $lastname" type of thing.
> > >
> > > On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > > there is the start of some information on Set:: at
> > >
> > > >
> http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-...
> > >
> > > > Sam D
> > >
> > > > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > > > Are you serious?
> > >
> > > > > Ok, you guys need a Set::combine tutorial or something!
> > >
> > > > > I've been trying to figure this out how to combine fields for a
> few
> > > > months
> > > > > now. I've been reduced to creating a custom array in a foreach
> loop.
> > >
> > > > > But I knew, deep down inside, there must be way.  ThanX
> > > > > --
> > > > > Baz L
> > > > > Web Development 2.0
> > > > >http://WebDevelopment2.com/
> > >
> >
> > > > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > It works, thank you very much!
> > > > > > Now i'm gonna try to make a function to combine the two
> functions :)
> > >
> > > > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > > > > > find('list') only works with simple fields, you won't be able
> to do
> > > > > > > this.
> > >
> > > > > > > Still, it's easy enough with find('all') and Set::combine():
> > >
> > > > > > > $people = $this->Person->find('all', array(
> > > > > > >   'fields' => array('id', 'firstname', 'insertion',
> 'surname'),
> > > > > > >   'recursive' => -1
> > > > > > > ));
> > > > > > > $list = Set::combine(
> > > > > > >   $people,
> > > > > > >   '{n}.Person.id',
> > > > > > >   array('%s %s %s', '{n}.Person.firstname',
> '{n}.Person.insertion',
> > > > > > > '{n}.Person.surname')
> > > > > > > );
> > >
> > > > > > > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > > > Hello cakephp friends,
> > >
> > > > > > > > I have 2 tables. Communications and people. In
> communications/add
> > > > i
> > > > > > > > want a list where you can choose one person from table
> people. But
> > > > you
> > > > > > > > don't see his name, only his ID. I have these fields in
> table
> > > > people:
> > >
> > > > > > > > id
> > > > > > > > firstname
> > > > > > > > insertion
> > > > > > > > surname
> > >
> > > > > > > > Can someone hel

Re: more fields in list function

2008-02-11 Thread Samuel DeVore

grigri, can you write up some of this and send to John for the
documentation project, this has got to get in there.

Sam D

On Feb 11, 2008 10:06 AM, grigri <[EMAIL PROTECTED]> wrote:
>
> It's easy, really - for each of the 3 fields (keyPath, valuePath and
> groupPath), instead of passing a string, you can pass an array.
>
> The first entry in the array is the format string, the rest are the
> parameters (extracted with Set::extract()).
>
> The format is exactly the same as sprintf() [it calls vsprintf()
> internally].
>
> So, passing array('%s %s', '{n}.Person.firstname',
> '{n}.Person.surname') as the valuePath does the following:
>
> * realizes it's an array, not a string
> * grabs the first entry ('%s %s') for the format, remembers the rest
> as parameters
> * for each parameter, calls Set::extract($data, ...) :
> + Set::extract($data, '{n}.Person.firstname');
> + Set::extract($data, '{n}.Person.last');
> * calls vsprintf($format, $parameters)
>
> You can also use "{1} {2}" as the format string instead of the
> sprintf() format, if you like. Personally I prefer the sprintf format,
> because I'm more used to it. Plus you can do things like padding,
> truncating and whatnot:
>
> Slightly more complicated example:
>
> $data = array(
>   array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname' =>
> 'Bloggs')),
>   array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname' =>
> 'Bloggs')),
>   array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname' =>
> 'Beam')),
>   array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname' =>
> 'Daniels')),
> );
>
> debug(Set::combine(
>   $data,
>   '{n}.User.id',
>   array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
>   '{n}.User.surname.0'
> ));
>
> result:
> Array
> (
> [B] => Array
> (
> [1] => Bloggs, J.
> [2] => Bloggs, F.
> [3] => Beam, J.
> )
>
> [D] => Array
> (
> [4] => Daniels, J.
> )
>
> )
>
> neat, no?
>
>
> On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> > Yeah, I've seen that a lot.
> >
> > What I was referring to with grigri's example is that :
> >
> > array(%s %s %s) thing for the path...
> >
> > I have tons of examples like these where I need to do a "$firstname -
> > $lastname" type of thing.
> >
> > On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > there is the start of some information on Set:: at
> >
> > >http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-...
> >
> > > Sam D
> >
> > > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > > Are you serious?
> >
> > > > Ok, you guys need a Set::combine tutorial or something!
> >
> > > > I've been trying to figure this out how to combine fields for a few
> > > months
> > > > now. I've been reduced to creating a custom array in a foreach loop.
> >
> > > > But I knew, deep down inside, there must be way.  ThanX
> > > > --
> > > > Baz L
> > > > Web Development 2.0
> > > >http://WebDevelopment2.com/
> >
>
> > > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
> >
> > > > > It works, thank you very much!
> > > > > Now i'm gonna try to make a function to combine the two functions :)
> >
> > > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > > > > find('list') only works with simple fields, you won't be able to do
> > > > > > this.
> >
> > > > > > Still, it's easy enough with find('all') and Set::combine():
> >
> > > > > > $people = $this->Person->find('all', array(
> > > > > >   'fields' => array('id', 'firstname', 'insertion', 'surname'),
> > > > > >   'recursive' => -1
> > > > > > ));
> > > > > > $list = Set::combine(
> > > > > >   $people,
> > > > > >   '{n}.Person.id',
> > > > > >   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> > > > > > '{n}.Person.surname')
> > > > > > );
> >
> > > > > > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > Hello cakephp friends,
> >
> > > > > > > I have 2 tables. Communications and people. In communications/add
> > > i
> > > > > > > want a list where you can choose one person from table people. But
> > > you
> > > > > > > don't see his name, only his ID. I have these fields in table
> > > people:
> >
> > > > > > > id
> > > > > > > firstname
> > > > > > > insertion
> > > > > > > surname
> >
> > > > > > > Can someone help me to make a list where you can see a persons
> > > > > > > firstname, insertion and surname with find('list' , .) in the
> > > > > > > communication controller.
> >
> > > > > > > Thanks in advance!- Tekst uit oorspronkelijk bericht niet
> > > weergeven -
> >
> > > > > > - Tekst uit oorspronkelijk bericht weergeven -
> >
> > > --
> > > --
> > > (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.s

Re: more fields in list function

2008-02-11 Thread grigri

It's easy, really - for each of the 3 fields (keyPath, valuePath and
groupPath), instead of passing a string, you can pass an array.

The first entry in the array is the format string, the rest are the
parameters (extracted with Set::extract()).

The format is exactly the same as sprintf() [it calls vsprintf()
internally].

So, passing array('%s %s', '{n}.Person.firstname',
'{n}.Person.surname') as the valuePath does the following:

* realizes it's an array, not a string
* grabs the first entry ('%s %s') for the format, remembers the rest
as parameters
* for each parameter, calls Set::extract($data, ...) :
+ Set::extract($data, '{n}.Person.firstname');
+ Set::extract($data, '{n}.Person.last');
* calls vsprintf($format, $parameters)

You can also use "{1} {2}" as the format string instead of the
sprintf() format, if you like. Personally I prefer the sprintf format,
because I'm more used to it. Plus you can do things like padding,
truncating and whatnot:

Slightly more complicated example:

$data = array(
  array('User' => array('id' => 1, 'firstname' => 'Joe', 'surname' =>
'Bloggs')),
  array('User' => array('id' => 2, 'firstname' => 'Fred', 'surname' =>
'Bloggs')),
  array('User' => array('id' => 3, 'firstname' => 'Jim', 'surname' =>
'Beam')),
  array('User' => array('id' => 4, 'firstname' => 'Jack', 'surname' =>
'Daniels')),
);

debug(Set::combine(
  $data,
  '{n}.User.id',
  array('%2$s, %1$.1s.', '{n}.User.firstname', '{n}.User.surname'),
  '{n}.User.surname.0'
));

result:
Array
(
[B] => Array
(
[1] => Bloggs, J.
[2] => Bloggs, F.
[3] => Beam, J.
)

[D] => Array
(
[4] => Daniels, J.
)

)

neat, no?


On Feb 11, 4:36 pm, Baz <[EMAIL PROTECTED]> wrote:
> Yeah, I've seen that a lot.
>
> What I was referring to with grigri's example is that :
>
> array(%s %s %s) thing for the path...
>
> I have tons of examples like these where I need to do a "$firstname -
> $lastname" type of thing.
>
> On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
>
>
> > there is the start of some information on Set:: at
>
> >http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-...
>
> > Sam D
>
> > On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > > Are you serious?
>
> > > Ok, you guys need a Set::combine tutorial or something!
>
> > > I've been trying to figure this out how to combine fields for a few
> > months
> > > now. I've been reduced to creating a custom array in a foreach loop.
>
> > > But I knew, deep down inside, there must be way.  ThanX
> > > --
> > > Baz L
> > > Web Development 2.0
> > >http://WebDevelopment2.com/
>
> > > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
>
> > > > It works, thank you very much!
> > > > Now i'm gonna try to make a function to combine the two functions :)
>
> > > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > > > find('list') only works with simple fields, you won't be able to do
> > > > > this.
>
> > > > > Still, it's easy enough with find('all') and Set::combine():
>
> > > > > $people = $this->Person->find('all', array(
> > > > >   'fields' => array('id', 'firstname', 'insertion', 'surname'),
> > > > >   'recursive' => -1
> > > > > ));
> > > > > $list = Set::combine(
> > > > >   $people,
> > > > >   '{n}.Person.id',
> > > > >   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> > > > > '{n}.Person.surname')
> > > > > );
>
> > > > > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello cakephp friends,
>
> > > > > > I have 2 tables. Communications and people. In communications/add
> > i
> > > > > > want a list where you can choose one person from table people. But
> > you
> > > > > > don't see his name, only his ID. I have these fields in table
> > people:
>
> > > > > > id
> > > > > > firstname
> > > > > > insertion
> > > > > > surname
>
> > > > > > Can someone help me to make a list where you can see a persons
> > > > > > firstname, insertion and surname with find('list' , .) in the
> > > > > > communication controller.
>
> > > > > > Thanks in advance!- Tekst uit oorspronkelijk bericht niet
> > weergeven -
>
> > > > > - Tekst uit oorspronkelijk bericht weergeven -
>
> > --
> > --
> > (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: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko

grigri,

I've upgraded my CakePHP core to current beta: rev. 6311 and can
verify that what you suggested works just fine!

AD7six, grigri, thank you both for your help!

On Feb 11, 2:24 pm, grigri <[EMAIL PROTECTED]> wrote:
> What version are you using? I just did a quick test using my
> playground database, and this:
>
> $this->set('test', $this->Tag->find('count', array('conditions' =>
> array('2=2','3=3'),
> 'recursive' => 0, 'fields' => array('(COUNT(DISTINCT Tag.parent_id))
> AS
> count';
>
> Generated this SQL:
>
> SELECT (COUNT(DISTINCT Tag.parent_id)) AS count FROM `tags` AS `Tag`
> LEFT JOIN `tags` AS `ParentTag` ON (`Tag`.`parent_id` =
> `ParentTag`.`id`) WHERE 2=2 AND 3=3
>
> As expected, which worked perfectly (rev. 6416).
>

--~--~-~--~~~---~--~~
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 1.2 Baking Question

2008-02-11 Thread rright

> Questions:
> - Linux/Windows
> - PHP and Cake console in %PATH% or calling each time?

I'm running xampp on Windows and Cake is installed in the xampp htdocs
folder:
"localhost://cake"

PHP and Cake console have been added to the Path environment variables
in Windows.

I want to clarify that baking works fine but my question is in the
resulting paths to my app.

After baking, the resulting path to my app is:
http://localhost/cake/project_name/project_name/

I want to know how to make my app accessible from this URL insteak:
http://localhost/cake/project_name/

Baking appears to double my project name twice in the URL string.
Perhaps this is by
design, I don't know. I'm a cake newbie and am just trying to
understand if what I'm
seeing is normal or if there is an adjustment I need to make to
achieve what I want.
--~--~-~--~~~---~--~~
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 php-cli with cake

2008-02-11 Thread Novice Programmer
Hello All,

I had a php script which i used to execute in background. This script was
called from some other php script. I used following to execute the script in
background:

$backscript = "test.php";

exec("$path_to_php $backscript params> /dev/null &");// (>/dev/null & part
is what sends to background)

Now i have turned this background script into an action of the controller
but still want to execute it in background. I am trying it as follows:

$backscript = "mycontroller/action";
exec("$path_to_php $backscript params> /dev/null &");// (>/dev/null & part
is what sends to background)

but with no success. Any help or pointers on doing this in cake will be
highly appreciated.

-- 
Thanks & Regards,
Novice (http://ishuonweb.wordpress.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: more fields in list function

2008-02-11 Thread Baz
Yeah, I've seen that a lot.

What I was referring to with grigri's example is that :

array(%s %s %s) thing for the path...

I have tons of examples like these where I need to do a "$firstname -
$lastname" type of thing.

On Feb 11, 2008 10:22 AM, Samuel DeVore <[EMAIL PROTECTED]> wrote:

>
> there is the start of some information on Set:: at
>
> http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/
>
> Sam D
>
> On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> > Are you serious?
> >
> > Ok, you guys need a Set::combine tutorial or something!
> >
> > I've been trying to figure this out how to combine fields for a few
> months
> > now. I've been reduced to creating a custom array in a foreach loop.
> >
> > But I knew, deep down inside, there must be way.  ThanX
> > --
> > Baz L
> > Web Development 2.0
> > http://WebDevelopment2.com/
> >
> >
> >
> > On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > It works, thank you very much!
> > > Now i'm gonna try to make a function to combine the two functions :)
> > >
> > > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > > find('list') only works with simple fields, you won't be able to do
> > > > this.
> > > >
> > > > Still, it's easy enough with find('all') and Set::combine():
> > > >
> > > > $people = $this->Person->find('all', array(
> > > >   'fields' => array('id', 'firstname', 'insertion', 'surname'),
> > > >   'recursive' => -1
> > > > ));
> > > > $list = Set::combine(
> > > >   $people,
> > > >   '{n}.Person.id',
> > > >   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> > > > '{n}.Person.surname')
> > > > );
> > > >
> > > > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > >
> > > > > Hello cakephp friends,
> > > >
> > > > > I have 2 tables. Communications and people. In communications/add
> i
> > > > > want a list where you can choose one person from table people. But
> you
> > > > > don't see his name, only his ID. I have these fields in table
> people:
> > > >
> > > > > id
> > > > > firstname
> > > > > insertion
> > > > > surname
> > > >
> > > > > Can someone help me to make a list where you can see a persons
> > > > > firstname, insertion and surname with find('list' , .) in the
> > > > > communication controller.
> > > >
> > > > > Thanks in advance!- Tekst uit oorspronkelijk bericht niet
> weergeven -
> > > >
> > > > - Tekst uit oorspronkelijk bericht weergeven -
> > >
> > >
> > >
> > >
> > > > >
> > >
> >
>
>
>
> --
> --
> (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: more fields in list function

2008-02-11 Thread Samuel DeVore

there is the start of some information on Set:: at
http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/

Sam D

On Feb 11, 2008 9:04 AM, Baz <[EMAIL PROTECTED]> wrote:
> Are you serious?
>
> Ok, you guys need a Set::combine tutorial or something!
>
> I've been trying to figure this out how to combine fields for a few months
> now. I've been reduced to creating a custom array in a foreach loop.
>
> But I knew, deep down inside, there must be way.  ThanX
> --
> Baz L
> Web Development 2.0
> http://WebDevelopment2.com/
>
>
>
> On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:
>
> >
> > It works, thank you very much!
> > Now i'm gonna try to make a function to combine the two functions :)
> >
> > On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > > find('list') only works with simple fields, you won't be able to do
> > > this.
> > >
> > > Still, it's easy enough with find('all') and Set::combine():
> > >
> > > $people = $this->Person->find('all', array(
> > >   'fields' => array('id', 'firstname', 'insertion', 'surname'),
> > >   'recursive' => -1
> > > ));
> > > $list = Set::combine(
> > >   $people,
> > >   '{n}.Person.id',
> > >   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> > > '{n}.Person.surname')
> > > );
> > >
> > > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> > >
> > >
> > >
> > > > Hello cakephp friends,
> > >
> > > > I have 2 tables. Communications and people. In communications/add i
> > > > want a list where you can choose one person from table people. But you
> > > > don't see his name, only his ID. I have these fields in table people:
> > >
> > > > id
> > > > firstname
> > > > insertion
> > > > surname
> > >
> > > > Can someone help me to make a list where you can see a persons
> > > > firstname, insertion and surname with find('list' , .) in the
> > > > communication controller.
> > >
> > > > Thanks in advance!- Tekst uit oorspronkelijk bericht niet weergeven -
> > >
> > > - Tekst uit oorspronkelijk bericht weergeven -
> >
> >
> >
> >
> > > >
> >
>



-- 
-- 
(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: more fields in list function

2008-02-11 Thread Baz
Are you serious?

Ok, you guys need a Set::combine tutorial or something!

I've been trying to figure this out how to combine fields for a few months
now. I've been reduced to creating a custom array in a foreach loop.

But I knew, deep down inside, there must be way.  ThanX
--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 11, 2008 3:59 AM, roryy <[EMAIL PROTECTED]> wrote:

>
> It works, thank you very much!
> Now i'm gonna try to make a function to combine the two functions :)
> On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> > find('list') only works with simple fields, you won't be able to do
> > this.
> >
> > Still, it's easy enough with find('all') and Set::combine():
> >
> > $people = $this->Person->find('all', array(
> >   'fields' => array('id', 'firstname', 'insertion', 'surname'),
> >   'recursive' => -1
> > ));
> > $list = Set::combine(
> >   $people,
> >   '{n}.Person.id',
> >   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> > '{n}.Person.surname')
> > );
> >
> > On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Hello cakephp friends,
> >
> > > I have 2 tables. Communications and people. In communications/add i
> > > want a list where you can choose one person from table people. But you
> > > don't see his name, only his ID. I have these fields in table people:
> >
> > > id
> > > firstname
> > > insertion
> > > surname
> >
> > > Can someone help me to make a list where you can see a persons
> > > firstname, insertion and surname with find('list' , .) in the
> > > communication controller.
> >
> > > Thanks in advance!- Tekst uit oorspronkelijk bericht niet weergeven -
> >
> > - Tekst uit oorspronkelijk bericht weergeven -
> >
>

--~--~-~--~~~---~--~~
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: Change the default fonts

2008-02-11 Thread Dardo Sordi Bogado

app/webroot/css/cake.generic.css ?

On Feb 11, 2008 1:08 PM, cakeBaker <[EMAIL PROTECTED]> wrote:
>
> Hi I am new to cake PHP. I am trying to change the default fonts of
> the texts, but I cannot find how. Can anybody help me please.
>
> thank you 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
-~--~~~~--~~--~--~---



Change the default fonts

2008-02-11 Thread cakeBaker

Hi I am new to cake PHP. I am trying to change the default fonts of
the texts, but I cannot find how. Can anybody help me please.

thank you 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: Cake 1.2 Baking Question

2008-02-11 Thread Baz
Questions:
- Linux/Windows
- PHP and Cake console in %PATH% or calling each time?

What exactly are you trying to accomplish? If you're baking a project you
need to call the script from the localhost/cake folder.
 - cake bake [project_name]

after this, you call all other bake commands from:
localhost\cake\[project_name]

I've experience weird results (not what you stated though) when my cake
console path was from a different folder from where I was trying to bake
toeg. I'm under my Cake Beta folder, but in the path Cake SVN
folderstuff gets funky ;)

--
Baz L
Web Development 2.0
http://WebDevelopment2.com/

On Feb 11, 2008 6:37 AM, rright <[EMAIL PROTECTED]> wrote:

>
> Thanks for the reply.
>
> > don't create a project, when already in an app folder.
>
> Actually I did not create a project using the bake script. I've so far
> started my project by
> using two different methods:
>
> 1) renamed a copy of the "app" folder within my cake directory to my
> app name
> 2) renamed a copy of the entire cake folder within my webroot to my
> app name
>
> From reading a couple of different tutorials, this was my
> understanding of how to best start
> a new project but if there is a better practice please let me know.
>
> In both methods mentioned above I then baked the model, controller and
> view. Both
> yielded the same results, where a folder named the same as my app is
> created within
> "views".
>
> >
>

--~--~-~--~~~---~--~~
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 way to handle ordered entries in MySQL

2008-02-11 Thread wirtsi

Thanks a lot to the two of you ...

AD7six code had some problems with the foreign key I'm using
(something I omitted for simplicity's sake :) ... and after I fixed it
I saw grigri's code which worked right out of the box. Very nice
indeed, thanks again!

As grigri mentioned, it doesn't use transactions or locks so I did
manage to break the proper jobcolumn_position sequence. In order to do
so, I wrote a test which randomly inserts and deletes jobs into the
columns.

If I run this this in Firefox only, everything works like a charm 
but when I do a large number of inserts/deletes and let the script run
from Opera simultaneously the position gets corrupted.

So what would be the best way to solve this with transactions? Make
the jobcolumn_position an UNIQUE INDEX and catch the error on save
( and how do I distinguish it from a normal "return false" on
Model->save()?).

If I don't UNIQUE then it would be quite a pain finding out if a
jobcolumn_position really is unique ...

Open for any suggestions ...

Thanks in advance

wirtsi




On 11 Feb., 11:40, grigri <[EMAIL PROTECTED]> wrote:
> I use this:http://bin.cakephp.org/view/634962728
>
> It's not based on the tree behavior [written from scratch], but it's
> not transactional and I've no idea of its performance on large tables
> as I've only ever used it on tables with less than 100-200 rows.
>
> On Feb 11, 10:20 am, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Feb 11, 11:13 am, wirtsi <[EMAIL PROTECTED]> wrote:
>
> > > Hi ...
>
> > > I'm aware that this is not 100% Cake specific ... but I got to deal
> > > with it atm in my Cake project so I hope you guys can help me out.
> > > What I got here is:
>
> > > A table containing around 1000 jobs (table framejobs) that need to be
> > > in a specific order. For that reason I created a table column called
> > > jobcolumn_position which I made a UNIQUE INDEX. Storage is MyISAM.
> > > Version is 1.2.0.5875 pre-beta.
>
> > I use this:http://bin.cakephp.org/view/1515101211
>
> > Which is a shameless, slimmed down tree behavior (as is obvious from
> > the unedited doc blocks).
>
> > hth,
>
> > AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse + PHP Cake

2008-02-11 Thread José Pablo Orozco Marín

http://www.aptana.com/studio/

http://www.evrsoft.com/1stpage2_features.shtml

http://tswebeditor.net.tc/

http://devphp.sourceforge.net/

http://www.zeusedit.com/php.html



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



Dynamic parentID() when using ACL

2008-02-11 Thread boyracerr

Hello to all,

I am keen to use ACL in my application. However, the requirement that
users only be in one group seems to me to be a massive obstacle.

As an example, imagine there is a bulletin board application with many
forums. Each forum will have members, moderators and administrators.
An administrator in one group may be only a member of another group
and so on.

I thought up a possible solution to the above, and I would appreciate
comments. As I understand it, tree navigation (and thus cascading
permissions) is implemented using the parentID() function, implemented
in the relevant model.

Would it be possible to write the parentID() function such that it
returned a different parentID depending on the current location in the
site.

For example:

User visits Forum1. He is only a member of this forum. parentID()
knows that he is visiting that particular forum, and thus returns
Forum1.members as the relevant parent group.

User visits Forum2. He is an administrator of this forum. parentID(),
based on the forum being viewed, returns Forum2.admins as the relevant
parent group.

Comments on the above? Would it work? Would it solve this problem?

Thanks,
Benjamin
--~--~-~--~~~---~--~~
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 1.2 Baking Question

2008-02-11 Thread rright

Thanks for the reply.

> don't create a project, when already in an app folder.

Actually I did not create a project using the bake script. I've so far
started my project by
using two different methods:

1) renamed a copy of the "app" folder within my cake directory to my
app name
2) renamed a copy of the entire cake folder within my webroot to my
app name

>From reading a couple of different tutorials, this was my
understanding of how to best start
a new project but if there is a better practice please let me know.

In both methods mentioned above I then baked the model, controller and
view. Both
yielded the same results, where a folder named the same as my app is
created within
"views".

--~--~-~--~~~---~--~~
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-11 Thread leo

I went through the mill of IDE's and editors trying to find something
I could use in the office without licence issues. At home I was using
PHP Designer freebie version, but the licencing prevents me from using
it at work.

A while back I used TextPad, and longer back, emacs, but not for PHP.
eventually I settled on Eclipse only to find it regularly ate up all
the available resources on my machine. I then moved onto NetBeans -
much better and it also had drag & drop - strangely absent in Eclipse.
I'm not a fan of the whole Java thing though - particularly the
baggage that comes with it  - 210MB for a text editor is a bad joke.

Now I use PSPad. It has projects, incorporates FTP, incremental search
etc. Best of all, it'll do mixed highlighting - very useful when you
have a template that includes PHP, HTML and Javascript. All with an
installed size of 10 meg. And it's a damn sight quicker than the Java
Bloaters.

Leo


On 11 Feb, 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: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko

I'm using rev. 5693. Didn't want to upgrade whenever a newer revision
appeared in the branch, and when the pre-beta was released we were
close to finishing the project - I didn't want to take the risk of
missing deadlines by fixing backward inconsistencies, etc.

Your example produced identical errors as the action in my controller.
So I guess it's related to my archaic revision of Cake. I guess I'd
still need to upgrade.

What revision would you recommend me to use - the current beta (rev.
6311) or what's currently in the trunk (branches and trunk both have
rev. 6455 currently)?

Thank you!

On 11 Фев, 14:24, grigri <[EMAIL PROTECTED]> wrote:
> What version are you using? I just did a quick test using my
> playground database, and this:
>
> $this->set('test', $this->Tag->find('count', array('conditions' =>
> array('2=2','3=3'),
> 'recursive' => 0, 'fields' => array('(COUNT(DISTINCT Tag.parent_id))
> AS
> count';
>
> Generated this SQL:
>
> SELECT (COUNT(DISTINCT Tag.parent_id)) AS count FROM `tags` AS `Tag`
> LEFT JOIN `tags` AS `ParentTag` ON (`Tag`.`parent_id` =
> `ParentTag`.`id`) WHERE 2=2 AND 3=3
>
> As expected, which worked perfectly (rev. 6416).
>

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

2008-02-11 Thread Ma'moon
Thanks for all the help guys :-)

On Fri, Feb 8, 2008 at 7:15 PM, Baz <[EMAIL PROTECTED]> wrote:

> Now that's what I would have to disagree with.
>
> Who really cares if CI pulls up the static page faster than Cake? I don't
> see the point in testing something that your application isn't going to be
> reflecting. Heck, we might as well slap on a .HTML file than benchmark that
> too.
>
> I think you'd need to design the same basic application across all your
> platforms and test that.
>
> Also, by definition, benchmarking requires some sort of comparison. Hence
> the multiple platforms.
>
>
> On Feb 8, 2008 11:00 AM, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]> wrote:
>
> >
> > There are a bunch of performance comparisons out there. Most may not
> > me very relevant in a real world project but if you need numbers here
> > are a few:
> >
> > http://paul-m-jones.com/blog/?p=236
> > http://www.sellersrank.com/php/cakephp-codeigniter-benchmark/
> >
> > Note: These try to test the most basic setup.
> >
> >
> >
> > On Feb 8, 5:04 pm, "Tom.Maiaroto" <[EMAIL PROTECTED]> wrote:
> > > ..oh and compared to other frameworks ??
> > >
> > > you could try and build the same app over and over and profile them
> > > all...but again it's gonna be hard and I would bet you'd get very
> > > similar results anyway.
> > > UNLESS you have some super huge monster of an app. That would be
> > > interesting to see.
> > >
> > > Like others said,  your development time is the most precious thing
> > > that Cake can help you with.
> > >
> > > On Feb 8, 11:02 am, "Tom.Maiaroto" <[EMAIL PROTECTED]> wrote:
> > >
> > > > You could setup xdebug or Zend and profile your sitebut
> > > > benchmarking is such a subjective thing.
> > > > It relies a lot on your server setup, etc.
> > >
> > > > What you could do is say build your own blog - and load it up with
> > the
> > > > same articles as say an installation of Wordpress or something. Then
> > > > profile both.
> > > > See the difference.
> > >
> > > > BUT that's only going to get you so far. Your specific machine's
> > > > PHP.ini, and other settings AND cpu speed/ram is different from the
> > > > host you'll be on (most likely)...AND you're testing locally - not
> > > > through the internet.
> > >
> > > > Now. A more accurate test would be to run the same test on the host
> > > > you'll be at...but can you get xdebug or something like that setup
> > on
> > > > your host?
> > >
> > > > Also, you've just gone through a bunch of time to find out if you
> > can
> > > > build an application faster than Wordpress or Drupal or Joomla! or
> > > > whatever.
> > >
> > > > My bet, you did build one faster...because all those systems load
> > > > extra things you probably don't have when you build a custom
> > solution.
> > >
> > > > These CMS' out there try to cover all the bases best they can. That
> > > > means a lot of overhead. A custom solution is -usually- going to be
> > > > faster.
> > >
> > > > Plus it's super hard to test for this anyway given all the
> > variables.
> > > > Just know that CakePHP has some really great scalability and
> > > > performance options with many different ways to cache data, VERY
> > good
> > > > control over your queries, and along with the design pattern and
> > such
> > > > it's really efficient for OO PHP...you just have to be sure you're
> > > > writing efficient code... ie. be aware of your findAll's and what
> > > > you're bringing back...do you need it all? Be aware of your custom
> > > > functions and special operations that you're using, etc.
> > >
> > > > In my opinion - Cake's the best thing since sliced bread for web
> > apps.
> > >
> > > > On Feb 8, 9:20 am, MattC <[EMAIL PROTECTED]> wrote:
> > >
> > > > > Regarding Zoe's comment about Cake checking the db columns every
> > time
> > > > > you retrieve data, that only happens when debug is on.  Otherwise
> > the
> > > > > table schema is cached.
> > >
> > > > > In general you should look into Cake's built in caching which can
> > > > > negate a lot of the framework overhead.  Here is quick test I did
> > to
> > > > > benchmark the improvement with cache turned on:
> > http://www.pseudocoder.com/archives/2007/02/27/cakephp-cache-performa...
> > >
> > > > > That was almost a year ago and used Cake 1.1 with file based
> > caching.
> > >
> > > > > -Mattwww.pseudocoder.com
> > >
> > > > > On Feb 8, 6:26 am, Ma'moon <[EMAIL PROTECTED]> wrote:
> > >
> > > > > > Hello guys,
> > > > > > i am truly sure that cake is my choice when it comes to choose a
> > framework
> > > > > > from the bunch of frameworks available out there but i really
> > need to see
> > > > > > some benchmarks in order to convince my managers that cake is
> > really for it
> > > > > > and it would be our best choice, is there any benchmarks reports
> > available,
> > > > > > i would be thankful for any links being posted here or pointed
> > anywhere
> > > > > > else.
> > >
> > > > > > Regards, Ma'moon
> >
>
>
> >
>

--~--~-~--~~--

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread grigri

What version are you using? I just did a quick test using my
playground database, and this:

$this->set('test', $this->Tag->find('count', array('conditions' =>
array('2=2','3=3'),
'recursive' => 0, 'fields' => array('(COUNT(DISTINCT Tag.parent_id))
AS
count';

Generated this SQL:

SELECT (COUNT(DISTINCT Tag.parent_id)) AS count FROM `tags` AS `Tag`
LEFT JOIN `tags` AS `ParentTag` ON (`Tag`.`parent_id` =
`ParentTag`.`id`) WHERE 2=2 AND 3=3

As expected, which worked perfectly (rev. 6416).

On Feb 11, 11:17 am, Nasko <[EMAIL PROTECTED]> wrote:
> grigri,
>
> I tried this an got this SQL query:
>
> SELECT Array, 1, COUNT(DISTINCT User.id) AS count, `User`.,
> `User`.`id` FROM `users` AS `User` LEFT JOIN `groups` AS `Group` ON
> (`User`.`group_id` = `Group`.`id`) LEFT JOIN `genders` AS `Gender` ON
> (`User`.`gender_id` = `Gender`.`id`) LEFT JOIN `countries` AS
> `Country` ON (`User`.`country_id` = `Country`.`id`) LEFT JOIN
> `gender_prefferences_users` AS `GenderPrefferenceUser` ON
> (`GenderPrefferenceUser`.`user_id` = `User`.`id`) WHERE count LIMIT 1
>
> 1064: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near ' `User`.`id` FROM `users` AS `User` LEFT JOIN `groups` AS
> `Group` ON (`User`.`gr' at line 1
>
> In addition the following notices were thrown:
>
> Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1424]
> Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1426]
> Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1429]
> Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1433]
> Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
> \dbo_source.php, line 1436]
> Notice (8): Array to string conversion [CORE\cake\libs\model
> \datasources\dbo_source.php, line 1186]
>
> On 11 Фев, 12:33, grigri <[EMAIL PROTECTED]> wrote:
>
> > try implementing User::paginateCount and changing the query:
>
> > class User extends AppModel {
> >   function paginateCount($conditions, $recursive) {
> > return $this->find('count', array('conditions' => $conditions,
> > 'recursive' => $recursive, 'fields' => 'COUNT(DISTINCT User.id) AS
> > count'));
> >   }
>
> > }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



CakePHP developer wanted

2008-02-11 Thread lloydhome

Lloydhome Consulting, Inc. (http://lloydhome.com) is looking for a PHP
developer for a six month contract with really good pay and a good
chance for extensions for the right person.  We provide fast, agile,
out-sourced development for large international corporations.  The
candidate should have experience in enterprise environments and
demonstrable ability to handle fast-changing requirements.  CakePHP,
AJAX, and MySql are required.

Preference given based on experience, team synergy, and proximity to
Atlanta Georgia USA/ North Georgia area as face time may be required
but telecommuting is the norm.

If interested, send Resume/CV and portfolio to
 [EMAIL PROTECTED]

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: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko

grigri,

I tried this an got this SQL query:

SELECT Array, 1, COUNT(DISTINCT User.id) AS count, `User`.,
`User`.`id` FROM `users` AS `User` LEFT JOIN `groups` AS `Group` ON
(`User`.`group_id` = `Group`.`id`) LEFT JOIN `genders` AS `Gender` ON
(`User`.`gender_id` = `Gender`.`id`) LEFT JOIN `countries` AS
`Country` ON (`User`.`country_id` = `Country`.`id`) LEFT JOIN
`gender_prefferences_users` AS `GenderPrefferenceUser` ON
(`GenderPrefferenceUser`.`user_id` = `User`.`id`) WHERE count LIMIT 1

1064: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ' `User`.`id` FROM `users` AS `User` LEFT JOIN `groups` AS
`Group` ON (`User`.`gr' at line 1

In addition the following notices were thrown:

Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1424]
Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  0 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  1 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  2 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  3 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  4 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1426]
Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1429]
Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1433]
Notice (8): Undefined offset:  5 [CORE\cake\libs\model\datasources
\dbo_source.php, line 1436]
Notice (8): Array to string conversion [CORE\cake\libs\model
\datasources\dbo_source.php, line 1186]



On 11 Фев, 12:33, grigri <[EMAIL PROTECTED]> wrote:
> try implementing User::paginateCount and changing the query:
>
> class User extends AppModel {
>   function paginateCount($conditions, $recursive) {
> return $this->find('count', array('conditions' => $conditions,
> 'recursive' => $recursive, 'fields' => 'COUNT(DISTINCT User.id) AS
> count'));
>   }
>
> }
>

--~--~-~--~~~---~--~~
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 way to handle ordered entries in MySQL

2008-02-11 Thread grigri

I use this: http://bin.cakephp.org/view/634962728

It's not based on the tree behavior [written from scratch], but it's
not transactional and I've no idea of its performance on large tables
as I've only ever used it on tables with less than 100-200 rows.

On Feb 11, 10:20 am, AD7six <[EMAIL PROTECTED]> wrote:
> On Feb 11, 11:13 am, wirtsi <[EMAIL PROTECTED]> wrote:
>
> > Hi ...
>
> > I'm aware that this is not 100% Cake specific ... but I got to deal
> > with it atm in my Cake project so I hope you guys can help me out.
> > What I got here is:
>
> > A table containing around 1000 jobs (table framejobs) that need to be
> > in a specific order. For that reason I created a table column called
> > jobcolumn_position which I made a UNIQUE INDEX. Storage is MyISAM.
> > Version is 1.2.0.5875 pre-beta.
>
> I use this:http://bin.cakephp.org/view/1515101211
>
> Which is a shameless, slimmed down tree behavior (as is obvious from
> the unedited doc blocks).
>
> hth,
>
> AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse + PHP Cake

2008-02-11 Thread RichardAtHome

Eclipse isnt smart enough to realise when php contain only 'chunks' of
code that are meant to be included with other chucks.

Likewise, having an editor parser that somehow 'runs' your code in the
back ground to be able to provide auto complete for dynamically added
libraries is probably asking too much ;-)

On Feb 11, 9:03 am, 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: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread grigri

try implementing User::paginateCount and changing the query:

class User extends AppModel {
  function paginateCount($conditions, $recursive) {
return $this->find('count', array('conditions' => $conditions,
'recursive' => $recursive, 'fields' => 'COUNT(DISTINCT User.id) AS
count'));
  }
}

On Feb 11, 9:43 am, Nasko <[EMAIL PROTECTED]> wrote:
> Andy, thank you for your input!
>
> Okay now I feel like a total **rk for asking something that has been
> a) explained so well in a discussion and b) stuck in the frequent
> discussion page :) The thing is I've actually read that specific
> discussion (plus a bunch of other threads/articles), but because I
> also read that specific thread back half an year ago when searching
> for a solution to a different problem - the trivial filtering of HABTM
> model - I haven't paid attention to the extra info on how to setup
> multiple joins. This time I just browsed the first couple of lines and
> thought that I recalled the discussion and it wouldn't help me as it
> was regarding a different matter :)
>
> Regarding the DISTINCT operator in fields - I tried setting the fields
> in $paginate as follows:
>
> $this->paginate['User'] = array(
> 'limit' => 3,
> 'page' => 1,
> 'order' => array('User.id' => 'desc'),
> 'fields' => array(
> 'DISTINCT User.id',
> 'User.*',
> )
> );
>
> Then, when setting an 'OR' type restriction (HabtmModel.foreign_key_id
> => array(id_1, id_2)), I'm getting the correct records, but wrong data
> in the counter:
> For example if 5 users match the restrictions, and one of them is
> associated with both habtm foreign keys I'm getting 5 records as per
> the DISTINCT operator, but the counter navigation is showing 6
> records:
>
> View 1 - 3 of 6
> 3 records listed
>
> View 4 - 6 of 6
> 2 records listed
>
> Examining the SQL shows that the DISTINCT operator is not applied the
> COUNT(*) MySQL query:
>
> SELECT COUNT(*) AS `count` FROM `users` AS `User` LEFT JOIN `groups`
> AS `Group` ON ...
> SELECT DISTINCT `User`.`id`, `User`.*, `User`.`id` FROM `users` AS
> `User` LEFT JOIN `groups` AS `Group` ON...
>
> Is there a workaround for this inconsistence?
>
> On 11 Фев, 10:55, AD7six <[EMAIL PROTECTED]> wrote:
>
> > you can specify fields in var $paginate
> >http://groups.google.com/group/cake-php/web/frequent-discussions
> > (filtering HABTM data (once more))
--~--~-~--~~~---~--~~
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 way to handle ordered entries in MySQL

2008-02-11 Thread AD7six



On Feb 11, 11:13 am, wirtsi <[EMAIL PROTECTED]> wrote:
> Hi ...
>
> I'm aware that this is not 100% Cake specific ... but I got to deal
> with it atm in my Cake project so I hope you guys can help me out.
> What I got here is:
>
> A table containing around 1000 jobs (table framejobs) that need to be
> in a specific order. For that reason I created a table column called
> jobcolumn_position which I made a UNIQUE INDEX. Storage is MyISAM.
> Version is 1.2.0.5875 pre-beta.

I use this: http://bin.cakephp.org/view/1515101211

Which is a shameless, slimmed down tree behavior (as is obvious from
the unedited doc blocks).

hth,

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



Re: Search problem

2008-02-11 Thread Axel Ariel Arroyo Braconi

You can use CONCAT function in conditions array like this.

$query = $this->data['Customer']['query_field']; //Or wherever you want
$conditions = array(CONCAT(Customer.first_name,' ',Customer.last_name)
like '%"$query"%');

You can use $conditiones to filter the search in paginate or other
method like findAll.
Try this and tell me if work.

Good Luck

Axel

On 2/11/08, Tuncinss <[EMAIL PROTECTED]> wrote:
>
> Hello Everybody,
>
> I am new to cakePHP and I have a little problem. I have 'first name'
> and 'last name'  fields in my customer database but while searching,
> I'd like to type customer's name in one field. In other words  for
> example, when I enter "john brown" in the search field, i want to see
> his profile although his full name was entered in two seperate fields.
> I wish I could explain my problem clear enough.
>
> >
>


-- 
Axel

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



Best way to handle ordered entries in MySQL

2008-02-11 Thread wirtsi

Hi ...

I'm aware that this is not 100% Cake specific ... but I got to deal
with it atm in my Cake project so I hope you guys can help me out.
What I got here is:

A table containing around 1000 jobs (table framejobs) that need to be
in a specific order. For that reason I created a table column called
jobcolumn_position which I made a UNIQUE INDEX. Storage is MyISAM.
Version is 1.2.0.5875 pre-beta.

So if I want to add another job I use the beforeSave callback to get
the highest jobcolumn_position, add 1 to it and save the latest
data ... like this (in model):

function beforeSave()
{
$this->query("LOCK TABLE {$this->table} AS `Framejob` WRITE,{$this-
>table} WRITE");
$this->data['Framejob']['modified'] = date("Y-m-d
H:i:s");
//new job create or column move!
if (!isset($this->data['Framejob']['jobcolumn_position']))
{
   $this->data['Framejob']['jobcolumn_position']  =>$this-
>getNextPos($this->data['Framejob']['jobcolumn_id']);
}
}

function afterSave()
{$this->query("UNLOCK TABLES"); }


/**
* @desc  get next free position for this season
*/
function getNextPos($jobcolumn_id)
{
$result = $this->field('jobcolumn_position','jobcolumn_id = '.
$jobcolumn_id,'jobcolumn_position DESC');
if (!empty($result) || $result == 0)
{
$position = $result;
$position++;
return $position;
}
else
{
$position = 0;
return $position;
}
}

So all this works nicely when inserting data but the problems arise
when I'm deleting entries ... I need to renumber alls jobs "above" the
deleted jobs jobcolumn_position so I don't get a hole in the
enumeration.

So
function beforeDelete()
{
$this->query("LOCK TABLE {$this->table} AS `Framejob` WRITE,
{$this->table} WRITE");
$this->read('',$this->id);
$this->query("UPDATE $this->table SET jobcolumn_position =
jobcolumn_position -1
WHERE jobcolumn_id = '".$this->data['Framejob']
['jobcolumn_id']."'
AND jobcolumn_position >= '".$this-
>data['Framejob']['jobcolumn_position']."'
ORDER BY jobcolumn_position ASC
");
return parent::beforeDelete();
}
function afterDelete()
{
$this->query("UNLOCK TABLES");
}

All this also works nicely when I manually add and remove entries ...
I wrote a script though that insert and deletes a few 1000 entries at
random and there it freaks out on me. I'm getting MySQL errors on
"duplicate entry on key jobcolumn_position" ...

So something wrong with the locking I suppose ... but then all this
locking seems to be terrible in style. Is there any other way to
handle a situation like this nice and easy without hacks like this? It
should be a something that is encountered often in web apps?

Thanks in advance for any advices ...

Best wishes

wirtsi
--~--~-~--~~~---~--~~
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: more fields in list function

2008-02-11 Thread roryy

It works, thank you very much!
Now i'm gonna try to make a function to combine the two functions :)
On 11 feb, 10:41, grigri <[EMAIL PROTECTED]> wrote:
> find('list') only works with simple fields, you won't be able to do
> this.
>
> Still, it's easy enough with find('all') and Set::combine():
>
> $people = $this->Person->find('all', array(
>   'fields' => array('id', 'firstname', 'insertion', 'surname'),
>   'recursive' => -1
> ));
> $list = Set::combine(
>   $people,
>   '{n}.Person.id',
>   array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
> '{n}.Person.surname')
> );
>
> On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello cakephp friends,
>
> > I have 2 tables. Communications and people. In communications/add i
> > want a list where you can choose one person from table people. But you
> > don't see his name, only his ID. I have these fields in table people:
>
> > id
> > firstname
> > insertion
> > surname
>
> > Can someone help me to make a list where you can see a persons
> > firstname, insertion and surname with find('list' , .) in the
> > communication controller.
>
> > Thanks in advance!- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -
--~--~-~--~~~---~--~~
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 images stored in database

2008-02-11 Thread abiram

Hi all i want store images in database actually images stored in
webroot img folder in database image path is entering it means only
img names or overall path and how to retrive viewpage like

and what path is save in database pls send answ

--~--~-~--~~~---~--~~
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 needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko

Andy, thank you for your input!

Okay now I feel like a total **rk for asking something that has been
a) explained so well in a discussion and b) stuck in the frequent
discussion page :) The thing is I've actually read that specific
discussion (plus a bunch of other threads/articles), but because I
also read that specific thread back half an year ago when searching
for a solution to a different problem - the trivial filtering of HABTM
model - I haven't paid attention to the extra info on how to setup
multiple joins. This time I just browsed the first couple of lines and
thought that I recalled the discussion and it wouldn't help me as it
was regarding a different matter :)

Regarding the DISTINCT operator in fields - I tried setting the fields
in $paginate as follows:

$this->paginate['User'] = array(
'limit' => 3,
'page' => 1,
'order' => array('User.id' => 'desc'),
'fields' => array(
'DISTINCT User.id',
'User.*',
)
);

Then, when setting an 'OR' type restriction (HabtmModel.foreign_key_id
=> array(id_1, id_2)), I'm getting the correct records, but wrong data
in the counter:
For example if 5 users match the restrictions, and one of them is
associated with both habtm foreign keys I'm getting 5 records as per
the DISTINCT operator, but the counter navigation is showing 6
records:

View 1 - 3 of 6
3 records listed

View 4 - 6 of 6
2 records listed

Examining the SQL shows that the DISTINCT operator is not applied the
COUNT(*) MySQL query:

SELECT COUNT(*) AS `count` FROM `users` AS `User` LEFT JOIN `groups`
AS `Group` ON ...
SELECT DISTINCT `User`.`id`, `User`.*, `User`.`id` FROM `users` AS
`User` LEFT JOIN `groups` AS `Group` ON...

Is there a workaround for this inconsistence?



On 11 Фев, 10:55, AD7six <[EMAIL PROTECTED]> wrote:

> you can specify fields in var $paginate

> http://groups.google.com/group/cake-php/web/frequent-discussions
> (filtering HABTM data (once more))
--~--~-~--~~~---~--~~
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: Image as Title in Paginator prev and next

2008-02-11 Thread duRqoo

Sure u can do that, just add 'escape'=>false to the options array.

On 11. Feb, 00:08 h., Tomka <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm using Version 1.2.
>
> Is it somehow possible to use an image or another html-content as
> title in the paginator's prev- and next-methods? Unfortunately my html
> is escaped.
> I'm looking for a parameter like in
> link ($title, $url=null, $htmlAttributes=array(),
> $confirmMessage=false, $escapeTitle=true)
> the last one.
>
> Thanks for answers.
> Tomka
--~--~-~--~~~---~--~~
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: more fields in list function

2008-02-11 Thread grigri

find('list') only works with simple fields, you won't be able to do
this.

Still, it's easy enough with find('all') and Set::combine():

$people = $this->Person->find('all', array(
  'fields' => array('id', 'firstname', 'insertion', 'surname'),
  'recursive' => -1
));
$list = Set::combine(
  $people,
  '{n}.Person.id',
  array('%s %s %s', '{n}.Person.firstname', '{n}.Person.insertion',
'{n}.Person.surname')
);

On Feb 11, 9:25 am, roryy <[EMAIL PROTECTED]> wrote:
> Hello cakephp friends,
>
> I have 2 tables. Communications and people. In communications/add i
> want a list where you can choose one person from table people. But you
> don't see his name, only his ID. I have these fields in table people:
>
> id
> firstname
> insertion
> surname
>
> Can someone help me to make a list where you can see a persons
> firstname, insertion and surname with find('list' , .) in the
> communication controller.
>
> 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
-~--~~~~--~~--~--~---



more fields in list function

2008-02-11 Thread roryy

Hello cakephp friends,

I have 2 tables. Communications and people. In communications/add i
want a list where you can choose one person from table people. But you
don't see his name, only his ID. I have these fields in table people:

id
firstname
insertion
surname

Can someone help me to make a list where you can see a persons
firstname, insertion and surname with find('list' , .) in the
communication controller.

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



Eclipse + PHP Cake

2008-02-11 Thread R

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



  1   2   >