Re: I hate CLI

2011-11-01 Thread Ryan Schmidt

On Nov 1, 2011, at 23:23, Jeremy Burns | Class Outfit wrote:

> Here's the tutorial and I think you are right. Typing it by hand does work. 
> ^^  Thanks.
> 
> https://github.com/davidpersson/media/blob/next/docs/TUTORIAL

Neat, it was neither an en-dash (U+2013) nor an em-dash (U+2014) but a minus 
sign (U+2212). Gotta love Unicode.

I filed an issue:

https://github.com/davidpersson/media/issues/68


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


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


CakepHP 2.0 plugins no longer cache in elements

2011-11-01 Thread Điển vũ
CakepHP 2.0 plugins no longer cache in elements.

Is it harder to code ? I use nocache a lots in cakephp 1.3.

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


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


Re: I hate CLI

2011-11-01 Thread Jeremy Burns | Class Outfit
Here's the tutorial and I think you are right. Typing it by hand does work. ^^  
Thanks.

https://github.com/davidpersson/media/blob/next/docs/TUTORIAL


Jeremy Burns
Class Outfit

Tel: +44 (0) 208 123 3822
Mob: +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 2 Nov 2011, at 01:38, Ryan Schmidt wrote:

> 
> On Nov 1, 2011, at 04:26, Jeremy Burns wrote:
> 
>> I'm following the tutorial for setting up David Persson's media
>> plugin. Each time I run this:
>> 
>> chmod -R a+rwX webroot/media/{transfer,filter}
>> 
>> ... in Terminal I get this error:
>> 
>> chmod: Invalid file mode: -R
> 
> 
> I have a feeling you didn't type the command yourself, but that you copied 
> and pasted from the tutorial's web page. You didn't provide the URL of the 
> tutorial, but I'll bet it was posted on some blog, and that the blog engine 
> helpfully converted the hyphen in "-R" into an en-dash ("–R") or em-dash 
> ("—R"). They look very similar on-screen, especially in a fixed-width font, 
> but they're totally different to the Terminal. I'm able to reproduce the 
> error you experienced if I use an en-dash or em-dash in place of the proper 
> hyphen. So the lesson is: sometimes it pays to type commands yourself instead 
> of copy/pasting, just be sure to transcribe them very carefully.
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: query

2011-11-01 Thread Jeremy Burns | Class Outfit
Recursive = 2 means "We don't know what we're doing and we've built it wrong, 
so we'll hit it with a big hammer until it works".

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 23:09, Chris Cinelli wrote:

> To clarify:
> -The login now work fine. Before it was taking 10-15 seconds to load.
> -The outsourcing team was using "find" on the user with recursive = 2 to 
> retrieve some information to store in the session. That query was generating 
> hundreds of queries. Not anymore.
> - Currently the page that is loaded just after the login (we are using Auth 
> now) has some information that related with other users. To render it, we 
> need a query that require 10+ joins. We get good response time now.
> -We currently use FetchAll in CakePHP 2.0 to use prepared statements. In Cake 
> 1.3 my colleague decided to implement his own datasource.
> 
> On Tue, Nov 1, 2011 at 3:41 PM, AD7six  wrote:
> 
> 
> On Nov 1, 8:24 pm, Chris Cinelli 
> wrote:
> > So, the reason we do not use "find" very often are both legacy (for me) and
> > practical.
> > Before I joined the company they were using an outsourcing team that
> > developed the most of the project. The login used to be VERY slow and the
> > engineer hired before of me found that the "find"s on the user at login
> > time, were performing a few hundred of queries. So he decide to go around
> > using pure SQL.
> >
> > I went through some of the source code of CakePHP but I admit that I did
> > not touch the ORM part at all. I am looking to our code right now. We have
> > a lot of queries that have to (left and inner) join 10+ tables ( I can see
> > a few with 11 and one with 12). There are a few problems about using
> > CakePHP ORM:
> >
> > 1) You hide to the developer the tables that you are going to use. First of
> > all in these case it is not so clear to know what the recursive number is
> > going to be. You still need to have the database schema in front of you.
> >
> > 2) It does not seem that the ORM give you a lot of control on how a query
> > is resolved.
> >
> > 3) CakePHP does not seem to do just one query but a few of them increasing
> > the time to get a result to unacceptable levels. The user table for example
> > is linked with at least 30 tables (probably more). Some of these
> > relationships are one to many. Some of the queries need to go 3-4 levels
> > deeper.  It is absolute madness to think that is Ok having cake making 200+
> > queries when you can get the result with one query. I read some complains
> > in some articles that were criticizing CakePHP's ORM comparing it to the
> > Ruby's one (that is still not the fastest). Maybe things can be done
> > better. If you have an application serving 200 users that are not too
> > demanding maybe it is Ok running 200+ queries in a find in a controller and
> > having the users sometimes wait for 10+ seconds to the system to respond.
> > But when the number of users increase to 10K+ and 100K+ nobody would be
> > able to use the system. Furthermore to deliver a good user experience, you
> > usually need to give an answer to the user in  > SQL query well designed you can do that.
> >
> > So in the end to have more control on how the data is accessed and keep and
> > acceptable speed we decided to use find only when it needs only one (rarely
> > two) tables and they have maximum one relationship with other table.
> >
> > I would really like to use the ORM, and I was a strong support of using the
> > ORM for everything but in practice it does not seem to scale well.
> > Am I missing something here ?
> 
> Query has it's place, but everything you've said indicates your
> appication is not using cake's orm as designed (login more than 1
> query? doing it rong)
> 
> AD
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread rchavik


On Wednesday, November 2, 2011 10:29:04 AM UTC+7, Yves S. Garret wrote:
>
> Where should the processing happen, controller or view? 
>

Controller.  See: http://book.cakephp.org/view/1232/Controller-Setup 
 

> Also, why is the second provider started with an upper-case letter?
>

I assume you're referring to: $this->set('provider', $this->paginate(*
'Provider'*, $conditions)); 

See: http://api13.cakephp.org/class/controller#method-Controllerpaginate 

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


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


Re: How to get related username in view?

2011-11-01 Thread Jeremy Burns | Class Outfit
This is basic stuff.

var $actsAs = array('Containable');
var $recursive = -1;

Ideally do this in app_model so that your whole app uses the Contain behaviour.

Your Category find is now:

$categories = $this->find(
'all',
array(
'conditions' => array('Category.category_id' => $id),
'Contain' => array(
'Post' => array(
'User' => array(
'User.id',
'User.name'
)
)
)
)
);


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 20:25, Andras Kende wrote:

> Since you are showing "posts" on the view maybe it would be better to show 
> that page from posts controller..
> It would be easier to get posts category users in a single query..
> 
> Andras Kende
> 
> On Nov 1, 2011, at 12:41 PM, Daniel wrote:
> 
>> I have a categories view which shows related posts that belong to the
>> category.  On the posts table there is a user_id which relates to a
>> username on the users table.  I would like to display the username for
>> each post on the category view, but when I put $post['User']
>> ['username'] into the ctp file I get an error message: "undefined
>> index: User"
>> 
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread Yves
Where should the processing happen, controller or view?  Also, why is the 
second provider started with an upper-case letter?

On Nov 1, 2011, at 10:25 PM, rchavik  wrote:

> On Wednesday, November 2, 2011 3:00:01 AM UTC+7, Yves S. Garret wrote:
> if(!empty($this->data['Provider']['last_name'])) {
> $this->set('provider', $this->Provider->find('all', 
> 
> array('conditions' => 
> array(
> 
> 'Provider.last_name LIKE' => $this->data['Provider']['last_name'].'%';
> }
> 
> Hmm, the find() will return all data. To enable pagination, the result must 
> be processed by Controller::paginate()
> 
> $this->set('provider', $this->paginate('Provider', $conditions));
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread rchavik
On Wednesday, November 2, 2011 3:00:01 AM UTC+7, Yves S. Garret wrote:

> if(!empty($this->data['Provider']['last_name'])) {
> $this->set('provider', $this->Provider->find('all', 
> 
> array('conditions' => 
> array(
> 
> 'Provider.last_name LIKE' => $this->data['Provider']['last_name'].'%';
> }
>

Hmm, the find() will return all data. To enable pagination, the result must 
be processed by Controller::paginate()

$this->set('provider', $this->paginate('Provider', $conditions));

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


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


Re: Implementing a search functionality

2011-11-01 Thread rchavik
I highly recommend to take a look at cakedc's search 
plugin. 
It's a little more involved to setup but worth the trouble to learn and use.

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


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


Re: Why the brackets/single-quotes around tables and columns?

2011-11-01 Thread Ryan Schmidt
And to explain why your table and field names are quoted at all, it's so that 
you don't get syntax errors and/or unexpected behavior if you happen to use a 
reserved word as a table or field name. Most of us probably wouldn't think to 
use "select" or "from" or "where" as a table or field name, but there are a 
surprising number of reserved words in SQL, and they vary by database engine, 
and later versions of the database engine might add new reserved words. So 
quoting table and field names is a great idea to future-proof your queries 
against one of your table or field names suddenly turning up as a reserved word 
later. So that's why CakePHP does that for you.


On Nov 1, 2011, at 11:07, mark_story wrote:

> To be a nitpick, those are backticks not single quotes.  Identifier
> quoting is different in every database vendor. So Cake adjusts
> accordingly.


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


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


Re: I hate CLI

2011-11-01 Thread Ryan Schmidt

On Nov 1, 2011, at 04:26, Jeremy Burns wrote:

> I'm following the tutorial for setting up David Persson's media
> plugin. Each time I run this:
> 
> chmod -R a+rwX webroot/media/{transfer,filter}
> 
> ... in Terminal I get this error:
> 
> chmod: Invalid file mode: -R


I have a feeling you didn't type the command yourself, but that you copied and 
pasted from the tutorial's web page. You didn't provide the URL of the 
tutorial, but I'll bet it was posted on some blog, and that the blog engine 
helpfully converted the hyphen in "-R" into an en-dash ("–R") or em-dash 
("—R"). They look very similar on-screen, especially in a fixed-width font, but 
they're totally different to the Terminal. I'm able to reproduce the error you 
experienced if I use an en-dash or em-dash in place of the proper hyphen. So 
the lesson is: sometimes it pays to type commands yourself instead of 
copy/pasting, just be sure to transcribe them very carefully.


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


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


Re: I hate CLI

2011-11-01 Thread Ryan Schmidt

On Nov 1, 2011, at 13:14, Daniel Luiz Pakuschewski wrote:

> chmod -r a+rwX webroot/media/transfer
> 
> -r lowercase.

No, on OS X 10.6.8 that produces the message:

chmod: a+rwX: No such file or directory

Uppercase -R was correct. From "man chmod" on OS X 10.6.8:

 -R  Change the modes of the file hierarchies rooted in the files
 instead of just the files themselves.

If your chmod command accepts "-r" lowercase, it is not BSD chmod.


On Nov 1, 2011, at 17:09, Matt Murphy wrote:

> The earlier messages were correct.  It is a parameter order option.

Yes, correct parameter order is essential, but Jeremy's original message stated 
that he ran the command "chmod -R a+rwX webroot/media/{transfer,filter}", which 
has all the arguments in the correct order. It should have worked just like 
that.




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


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


Re: query

2011-11-01 Thread #2Will
Arn't you using contain?  I think if you set recursive = -1 for all
the models and created your finds with contains to the models you
actually needed, you wouldn't be hiding what tables are being queried,
and the performance wouldn't be bad.


w

On Nov 2, 6:24 am, Chris Cinelli 
wrote:
> So, the reason we do not use "find" very often are both legacy (for me) and
> practical.
> Before I joined the company they were using an outsourcing team that
> developed the most of the project. The login used to be VERY slow and the
> engineer hired before of me found that the "find"s on the user at login
> time, were performing a few hundred of queries. So he decide to go around
> using pure SQL.
>
> I went through some of the source code of CakePHP but I admit that I did
> not touch the ORM part at all. I am looking to our code right now. We have
> a lot of queries that have to (left and inner) join 10+ tables ( I can see
> a few with 11 and one with 12). There are a few problems about using
> CakePHP ORM:
>
> 1) You hide to the developer the tables that you are going to use. First of
> all in these case it is not so clear to know what the recursive number is
> going to be. You still need to have the database schema in front of you.
>
> 2) It does not seem that the ORM give you a lot of control on how a query
> is resolved.
>
> 3) CakePHP does not seem to do just one query but a few of them increasing
> the time to get a result to unacceptable levels. The user table for example
> is linked with at least 30 tables (probably more). Some of these
> relationships are one to many. Some of the queries need to go 3-4 levels
> deeper.  It is absolute madness to think that is Ok having cake making 200+
> queries when you can get the result with one query. I read some complains
> in some articles that were criticizing CakePHP's ORM comparing it to the
> Ruby's one (that is still not the fastest). Maybe things can be done
> better. If you have an application serving 200 users that are not too
> demanding maybe it is Ok running 200+ queries in a find in a controller and
> having the users sometimes wait for 10+ seconds to the system to respond.
> But when the number of users increase to 10K+ and 100K+ nobody would be
> able to use the system. Furthermore to deliver a good user experience, you
> usually need to give an answer to the user in  SQL query well designed you can do that.
>
> So in the end to have more control on how the data is accessed and keep and
> acceptable speed we decided to use find only when it needs only one (rarely
> two) tables and they have maximum one relationship with other table.
>
> I would really like to use the ORM, and I was a strong support of using the
> ORM for everything but in practice it does not seem to scale well.
> Am I missing something here ?
>
> Best,
>     Chris
>
>
>
>
>
>
>
> On Tue, Nov 1, 2011 at 2:43 AM, WebbedIT  wrote:
> > @Chris: Please no, not another person advocating the use of $this-
> > >query()!  Although this one is really special as anytime you join two
> > models you give up and revert to running your own SQL?!?
>
> > Just because you can't get your head around associating models
> > together and running Model::find (should get your head around
> > containable too) does not mean you should recommend to others early in
> > the learning curve to follow your cop-out path.
>
> > There are so many reasons to learn how to use Cake properly and it
> > certainly does not make life harder, in fact you could not be further
> > from the truth.  OK there are some circumstances where you need to
> > learn how to leverage Model::find a little, but these are very few and
> > far between and the benefits of having your data arrays passed back in
> > a manner that the Form helper and Model::save expects them in saves
> > you a ton of time.
>
> > Please go back to the book and take the time to learn it and don't
> > advise others to give up on it.
>
> > Paul.
>
> > On Oct 31, 9:07 am, Chris Cinelli
> >  wrote:
> > > We have complicated queries that span across 8 tables. We decided to use
> > > pure SQL code. We defined our data source and run SQL through it defining
> > > our custom methods in the model that execute the query. If the query is
> > > just on one table we use the ORM but pure SQL pretty much in the other
> > > cases. The purpouse of the ORM layer is to make things easier. If you
> > make
> > > it  more complicated, why are you doing it?
> > > On Oct 31, 2011 1:55 AM, "WebbedIT"  wrote:
>
> > > > Without seeing any of your code (model associations would have been
> > > > nice) I logically assume you are using Article HABTM Tag.
>
> > > > If so this does not create a model for the join table, but instead
> > > > puts in place some automagic to allow you to link many-to-many records
> > > > between the two models.  As such you can't run a find on the join
> > > > model, which is what you would have to do to be able to have
> > > > conditions spanning the three tables.
>
> > > 

Re: query

2011-11-01 Thread Chris Cinelli
To clarify:
-The login now work fine. Before it was taking 10-15 seconds to load.
-The outsourcing team was using "find" on the user with recursive = 2 to
retrieve some information to store in the session. That query was
generating hundreds of queries. Not anymore.
- Currently the page that is loaded just after the login (we are using Auth
now) has some information that related with other users. To render it, we
need a query that require 10+ joins. We get good response time now.
-We currently use FetchAll in CakePHP 2.0 to use prepared statements. In
Cake 1.3 my colleague decided to implement his own datasource.

On Tue, Nov 1, 2011 at 3:41 PM, AD7six  wrote:

>
>
> On Nov 1, 8:24 pm, Chris Cinelli 
> wrote:
> > So, the reason we do not use "find" very often are both legacy (for me)
> and
> > practical.
> > Before I joined the company they were using an outsourcing team that
> > developed the most of the project. The login used to be VERY slow and the
> > engineer hired before of me found that the "find"s on the user at login
> > time, were performing a few hundred of queries. So he decide to go around
> > using pure SQL.
> >
> > I went through some of the source code of CakePHP but I admit that I did
> > not touch the ORM part at all. I am looking to our code right now. We
> have
> > a lot of queries that have to (left and inner) join 10+ tables ( I can
> see
> > a few with 11 and one with 12). There are a few problems about using
> > CakePHP ORM:
> >
> > 1) You hide to the developer the tables that you are going to use. First
> of
> > all in these case it is not so clear to know what the recursive number is
> > going to be. You still need to have the database schema in front of you.
> >
> > 2) It does not seem that the ORM give you a lot of control on how a query
> > is resolved.
> >
> > 3) CakePHP does not seem to do just one query but a few of them
> increasing
> > the time to get a result to unacceptable levels. The user table for
> example
> > is linked with at least 30 tables (probably more). Some of these
> > relationships are one to many. Some of the queries need to go 3-4 levels
> > deeper.  It is absolute madness to think that is Ok having cake making
> 200+
> > queries when you can get the result with one query. I read some complains
> > in some articles that were criticizing CakePHP's ORM comparing it to the
> > Ruby's one (that is still not the fastest). Maybe things can be done
> > better. If you have an application serving 200 users that are not too
> > demanding maybe it is Ok running 200+ queries in a find in a controller
> and
> > having the users sometimes wait for 10+ seconds to the system to respond.
> > But when the number of users increase to 10K+ and 100K+ nobody would be
> > able to use the system. Furthermore to deliver a good user experience,
> you
> > usually need to give an answer to the user in  > SQL query well designed you can do that.
> >
> > So in the end to have more control on how the data is accessed and keep
> and
> > acceptable speed we decided to use find only when it needs only one
> (rarely
> > two) tables and they have maximum one relationship with other table.
> >
> > I would really like to use the ORM, and I was a strong support of using
> the
> > ORM for everything but in practice it does not seem to scale well.
> > Am I missing something here ?
>
> Query has it's place, but everything you've said indicates your
> appication is not using cake's orm as designed (login more than 1
> query? doing it rong)
>
> AD
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: query

2011-11-01 Thread AD7six


On Nov 1, 8:24 pm, Chris Cinelli 
wrote:
> So, the reason we do not use "find" very often are both legacy (for me) and
> practical.
> Before I joined the company they were using an outsourcing team that
> developed the most of the project. The login used to be VERY slow and the
> engineer hired before of me found that the "find"s on the user at login
> time, were performing a few hundred of queries. So he decide to go around
> using pure SQL.
>
> I went through some of the source code of CakePHP but I admit that I did
> not touch the ORM part at all. I am looking to our code right now. We have
> a lot of queries that have to (left and inner) join 10+ tables ( I can see
> a few with 11 and one with 12). There are a few problems about using
> CakePHP ORM:
>
> 1) You hide to the developer the tables that you are going to use. First of
> all in these case it is not so clear to know what the recursive number is
> going to be. You still need to have the database schema in front of you.
>
> 2) It does not seem that the ORM give you a lot of control on how a query
> is resolved.
>
> 3) CakePHP does not seem to do just one query but a few of them increasing
> the time to get a result to unacceptable levels. The user table for example
> is linked with at least 30 tables (probably more). Some of these
> relationships are one to many. Some of the queries need to go 3-4 levels
> deeper.  It is absolute madness to think that is Ok having cake making 200+
> queries when you can get the result with one query. I read some complains
> in some articles that were criticizing CakePHP's ORM comparing it to the
> Ruby's one (that is still not the fastest). Maybe things can be done
> better. If you have an application serving 200 users that are not too
> demanding maybe it is Ok running 200+ queries in a find in a controller and
> having the users sometimes wait for 10+ seconds to the system to respond.
> But when the number of users increase to 10K+ and 100K+ nobody would be
> able to use the system. Furthermore to deliver a good user experience, you
> usually need to give an answer to the user in  SQL query well designed you can do that.
>
> So in the end to have more control on how the data is accessed and keep and
> acceptable speed we decided to use find only when it needs only one (rarely
> two) tables and they have maximum one relationship with other table.
>
> I would really like to use the ORM, and I was a strong support of using the
> ORM for everything but in practice it does not seem to scale well.
> Am I missing something here ?

Query has it's place, but everything you've said indicates your
appication is not using cake's orm as designed (login more than 1
query? doing it rong)

AD

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


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


Re: ajax with cakephp 1.3

2011-11-01 Thread Yves S. Garret
Hi.

   Please paste your code into bin.cakephp.org and post it here.  It would
make it easier to help you.

On Tue, Nov 1, 2011 at 6:13 PM, pedro rojo  wrote:

> Good evening!
>
> please I just created a Website and I can not understand how programmed
> two linked lists ie when selectionnne an option from a list the other list
> will automatically change to AJAX in CakePHP framework.
> I have not found cherchémais suitable solution: (
> help me if you have a solution!
> thank you for your support
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


ajax with cakephp 1.3

2011-11-01 Thread pedro rojo
Good evening!

please I just created a Website and I can not understand how
programmed two linked
lists ie when selectionnne an option from a list the other list will
automatically
change to AJAX in CakePHP framework.
I have not found cherchémais suitable solution: (
help me if you have a solution!
thank you for your support

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


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


Re: I hate CLI

2011-11-01 Thread Matt Murphy
The earlier messages were correct.  It is a parameter order option.

On Tue, Nov 1, 2011 at 7:02 AM, Ma'moon  wrote:

> Will you try without -R option
>
>
> On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> /Sites/mysitename/app
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 1 Nov 2011, at 10:33, Ma'moon wrote:
>>
>> Are you executing the command from the directory that contains the
>> webroot folder?, please run pwd to make sure of the location that you are
>> executing this command from
>>
>> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> Running that command from app I get:
>>>
>>> chmod: -R: No such file or directory
>>>
>>> chmod a+rwX webroot/media/{transfer,filter} -R
>>>
>>> ... returns the same result too.
>>>
>>> The directories do exist.
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> Tel: +44 (0) 208 123 3822
>>> Mob: +44 (0) 7973 481949
>>> Skype: jeremy_burns
>>> http://www.classoutfit.com
>>>
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> http://www.classoutfit.com
>>>
>>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>>>
>>> try this chmod a+rwX -R webroot/media/{transfer,filter}
>>>
>>> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns <
>>> jeremybu...@classoutfit.com> wrote:
>>>
 I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
 into a black hole. Give me something I can point at and click and I'm
 a happy man.

 I'm following the tutorial for setting up David Persson's media
 plugin. Each time I run this:

 chmod -R a+rwX webroot/media/{transfer,filter}

 ... in Terminal I get this error:

 chmod: Invalid file mode: -R

 I have Googled but can't find the answer. Can any of you CLI junkies
 help me out please?

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


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

>>>
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>>
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>>
>>  --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Admin Routing

2011-11-01 Thread Sam Sherlock
The thread was titled

Going back to school: acl

- S
On 1 Nov 2011 21:52, "Sam Sherlock"  wrote:

> Yep then you need acl
>
> I saw a recent thread discussing a work-around to avoid all the extra
> methods views
>
> Does sound good.
>
> - S
> On 1 Nov 2011 21:44, "Nate"  wrote:
>
>> So what if I have different levels of management?
>>
>> Super Administrators
>> Administrators
>> Managers
>>
>>
>> Managers have a set of options.
>> Administrators have all options that Managers have, and then some.
>> Super Administrators have all options that Managers and Administrators
>> have, and then some.
>>
>> I'd rather not create 3 or 4 different admin views for each usergroup
>> - but check to see if a user is part of a usergroup and then display
>> or hide the additional options.
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>

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


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


Re: Admin Routing

2011-11-01 Thread Sam Sherlock
Yep then you need acl

I saw a recent thread discussing a work-around to avoid all the extra
methods views

Does sound good.

- S
On 1 Nov 2011 21:44, "Nate"  wrote:

> So what if I have different levels of management?
>
> Super Administrators
> Administrators
> Managers
>
>
> Managers have a set of options.
> Administrators have all options that Managers have, and then some.
> Super Administrators have all options that Managers and Administrators
> have, and then some.
>
> I'd rather not create 3 or 4 different admin views for each usergroup
> - but check to see if a user is part of a usergroup and then display
> or hide the additional options.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Admin Routing

2011-11-01 Thread Nate
So what if I have different levels of management?

Super Administrators
Administrators
Managers


Managers have a set of options.
Administrators have all options that Managers have, and then some.
Super Administrators have all options that Managers and Administrators
have, and then some.

I'd rather not create 3 or 4 different admin views for each usergroup
- but check to see if a user is part of a usergroup and then display
or hide the additional options.

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


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


Re: Admin Routing

2011-11-01 Thread Sam Sherlock
Thats what it is

And you use admin_index methods distinct from index method.

 - S
On 1 Nov 2011 21:25, "Nate"  wrote:

> So I'm reading over the Simple ACL tutorial provided in the
> documentation.
>
> Right at the beginning, it says...
> "Leave out admin routing for now, this is a complicated enough subject
> without them."
>
> Can anyone give me any links or information on what exactly Admin
> Routing is and how to utilize it?
>
> I'm assuming it's something like mysite.com/admin and an administrator
> interface.  I definitely need that :)
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Admin Routing

2011-11-01 Thread Nate
So I'm reading over the Simple ACL tutorial provided in the
documentation.

Right at the beginning, it says...
"Leave out admin routing for now, this is a complicated enough subject
without them."

Can anyone give me any links or information on what exactly Admin
Routing is and how to utilize it?

I'm assuming it's something like mysite.com/admin and an administrator
interface.  I definitely need that :)

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


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


Re: How to get related username in view?

2011-11-01 Thread Andras Kende
Since you are showing "posts" on the view maybe it would be better to show that 
page from posts controller..
It would be easier to get posts category users in a single query..

Andras Kende

On Nov 1, 2011, at 12:41 PM, Daniel wrote:

> I have a categories view which shows related posts that belong to the
> category.  On the posts table there is a user_id which relates to a
> username on the users table.  I would like to display the username for
> each post on the category view, but when I put $post['User']
> ['username'] into the ctp file I get an error message: "undefined
> index: User"
> 
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread Yves S. Garret
Ok, this is weird.  It does pagination, which is good.  The problem arises
is that when I run the search, after it it runs again, for all of the names
in the DB... on the first page the search results are displayed, but on the
next, the rest of the data is displayed!  Does pagination run some other
search in the background or after the fact?  This is weird, please help out.

On Tue, Nov 1, 2011 at 4:00 PM, Yves S. Garret
wrote:

> Ok, as I have it works.  Yay!
>
> The thing that was tripping me up was that the pagination ran _after_ the
> search.
>
> This is how view_admit_lookup is now.
>
> function view_admit_lookup() {
> $this->helpers['Paginator'] = array('ajax' => 'ajax');
> // provide pagination for the user.
> $this->set('provider', $this->paginate());
>
> // here we begin searching for whatever we need.
> if(!empty($this->data['Provider']['last_name'])) {
> $this->set('provider', $this->Provider->find('all',
>
> array('conditions' =>
> array(
>
> 'Provider.last_name LIKE' => $this->data['Provider']['last_name'].'%';
> }
>
> // set the title and the default layout.
> $this->set('title_for_layout', 'Admit Lookup');
> $this->layout = 'default';
> }
>
> On Tue, Nov 1, 2011 at 1:10 PM, Yves S. Garret  > wrote:
>
>> Ok, one more time!
>>
>> This is my view:
>> http://bin.cakephp.org/view/859204807
>> My model:
>> http://bin.cakephp.org/view/455436825
>> My controller:
>> http://bin.cakephp.org/view/2083728780
>>
>> Now, what happens is that when I run a search for, say, Smith, the page
>> just refreshes with all of the stuff as it was.  I inserted debug code
>> (lines 31 & 32) in the if-statement just to see what was going on and turns
>> out nothing was going >_>
>>
>> Should I run this after the pagination?
>>
>>
>> On Tue, Nov 1, 2011 at 11:29 AM, Jeremy Burns | Class Outfit <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> You're right of course. Now if you are American, it would be ironic that
>>> you understand sarcasm (or irony)!
>>>
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> http://www.classoutfit.com
>>>
>>> On 1 Nov 2011, at 15:22, Jon Bennett wrote:
>>>
>>> I hope we all know that I was being ironic. ^^
>>>
>>>
>>> Don't think that's irony, more sarcasm ;)
>>>
>>> j
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>>
>>>  --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>
>>
>

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


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


Re: How to get related username in view?

2011-11-01 Thread Jeremy Burns | Class Outfit
Containable behaviour.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 18:39, flo.kl...@googlemail.com wrote:

> Set up the relationships in the posts and users models and set the recursion 
> to 2 when you do the find.
> 
> -flosky
> 
> 
> 
> Daniel  schrieb:
> Yes, you're right 'users' it is not in the 'categories' model.  How do
> I get it in the model?  Bear in mind that 'users' are not directly
> related to categories.  Here is the relationship that is in the
> 'categories' model:
> 
>   var $hasMany = array(
>   'Post' => array(
>   'className' => 'Post',
>   'foreignKey' => 'category_id',
>   'dependent' => false,
>   'conditions' => '',
>   'fields' => '',
>   'order' => '',
>   'limit' => '',
>   'offset' => '',
>   'exclusive' => '',
>   'finderQuery' => '',
>   'counterQuery' => ''
>   )
>   );
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others
> with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread Yves S. Garret
Ok, as I have it works.  Yay!

The thing that was tripping me up was that the pagination ran _after_ the
search.

This is how view_admit_lookup is now.

function view_admit_lookup() {
$this->helpers['Paginator'] = array('ajax' => 'ajax');
// provide pagination for the user.
$this->set('provider', $this->paginate());

// here we begin searching for whatever we need.
if(!empty($this->data['Provider']['last_name'])) {
$this->set('provider', $this->Provider->find('all',

array('conditions' =>
array(

'Provider.last_name LIKE' => $this->data['Provider']['last_name'].'%';
}

// set the title and the default layout.
$this->set('title_for_layout', 'Admit Lookup');
$this->layout = 'default';
}

On Tue, Nov 1, 2011 at 1:10 PM, Yves S. Garret
wrote:

> Ok, one more time!
>
> This is my view:
> http://bin.cakephp.org/view/859204807
> My model:
> http://bin.cakephp.org/view/455436825
> My controller:
> http://bin.cakephp.org/view/2083728780
>
> Now, what happens is that when I run a search for, say, Smith, the page
> just refreshes with all of the stuff as it was.  I inserted debug code
> (lines 31 & 32) in the if-statement just to see what was going on and turns
> out nothing was going >_>
>
> Should I run this after the pagination?
>
>
> On Tue, Nov 1, 2011 at 11:29 AM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> You're right of course. Now if you are American, it would be ironic that
>> you understand sarcasm (or irony)!
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 1 Nov 2011, at 15:22, Jon Bennett wrote:
>>
>> I hope we all know that I was being ironic. ^^
>>
>>
>> Don't think that's irony, more sarcasm ;)
>>
>> j
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>>
>>  --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>

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


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


Re: query

2011-11-01 Thread Chris Cinelli
So, the reason we do not use "find" very often are both legacy (for me) and
practical.
Before I joined the company they were using an outsourcing team that
developed the most of the project. The login used to be VERY slow and the
engineer hired before of me found that the "find"s on the user at login
time, were performing a few hundred of queries. So he decide to go around
using pure SQL.

I went through some of the source code of CakePHP but I admit that I did
not touch the ORM part at all. I am looking to our code right now. We have
a lot of queries that have to (left and inner) join 10+ tables ( I can see
a few with 11 and one with 12). There are a few problems about using
CakePHP ORM:

1) You hide to the developer the tables that you are going to use. First of
all in these case it is not so clear to know what the recursive number is
going to be. You still need to have the database schema in front of you.

2) It does not seem that the ORM give you a lot of control on how a query
is resolved.

3) CakePHP does not seem to do just one query but a few of them increasing
the time to get a result to unacceptable levels. The user table for example
is linked with at least 30 tables (probably more). Some of these
relationships are one to many. Some of the queries need to go 3-4 levels
deeper.  It is absolute madness to think that is Ok having cake making 200+
queries when you can get the result with one query. I read some complains
in some articles that were criticizing CakePHP's ORM comparing it to the
Ruby's one (that is still not the fastest). Maybe things can be done
better. If you have an application serving 200 users that are not too
demanding maybe it is Ok running 200+ queries in a find in a controller and
having the users sometimes wait for 10+ seconds to the system to respond.
But when the number of users increase to 10K+ and 100K+ nobody would be
able to use the system. Furthermore to deliver a good user experience, you
usually need to give an answer to the user in  wrote:

> @Chris: Please no, not another person advocating the use of $this-
> >query()!  Although this one is really special as anytime you join two
> models you give up and revert to running your own SQL?!?
>
> Just because you can't get your head around associating models
> together and running Model::find (should get your head around
> containable too) does not mean you should recommend to others early in
> the learning curve to follow your cop-out path.
>
> There are so many reasons to learn how to use Cake properly and it
> certainly does not make life harder, in fact you could not be further
> from the truth.  OK there are some circumstances where you need to
> learn how to leverage Model::find a little, but these are very few and
> far between and the benefits of having your data arrays passed back in
> a manner that the Form helper and Model::save expects them in saves
> you a ton of time.
>
> Please go back to the book and take the time to learn it and don't
> advise others to give up on it.
>
> Paul.
>
> On Oct 31, 9:07 am, Chris Cinelli
>  wrote:
> > We have complicated queries that span across 8 tables. We decided to use
> > pure SQL code. We defined our data source and run SQL through it defining
> > our custom methods in the model that execute the query. If the query is
> > just on one table we use the ORM but pure SQL pretty much in the other
> > cases. The purpouse of the ORM layer is to make things easier. If you
> make
> > it  more complicated, why are you doing it?
> > On Oct 31, 2011 1:55 AM, "WebbedIT"  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Without seeing any of your code (model associations would have been
> > > nice) I logically assume you are using Article HABTM Tag.
> >
> > > If so this does not create a model for the join table, but instead
> > > puts in place some automagic to allow you to link many-to-many records
> > > between the two models.  As such you can't run a find on the join
> > > model, which is what you would have to do to be able to have
> > > conditions spanning the three tables.
> >
> > > Your options are to use unbind and bind to force joins that you can
> > > use:
> >
> > >http://nuts-and-bolts-of-cakephp.com/2008/08/06/habtm-and-join-tricke.
> ..
> >
> > > Or, my preferred option is to create a model for join tables
> >
> > > Article hasMany ArticleTag
> > > Tag hasMany ArticleTag
> > > ArticleTag belongsTo Article, Tag
> >
> > > This allows you to easily add extra fields into your join table and to
> > > run $this->Article->ArticleTag->find('all', array('conditions'=>array(
> > >  'Article.is_read'=>0,
> > >  'Article.status'=>1,
> > >  'Tag.name'=>'cakephp'
> > > )));
> >
> > > HTH, Paul.
> >
> > > P.S. Notice how I have changed some of your field names and values.
> > > Your isRead field should be lowercased and underscored and if boolen
> > > use tinyint(1) with 0 and 1.  When searching for articles by tag you
> > > would normally recieve the tagname in the request (much better for
> > 

Re: How to get related username in view?

2011-11-01 Thread flo.kl...@googlemail.com
Set up the relationships in the posts and users models and set the recursion to 
2 when you do the find.

-flosky



Daniel  schrieb:

Yes, you're right 'users' it is not in the 'categories' model. How do
I get it in the model? Bear in mind that 'users' are not directly
related to categories. Here is the relationship that is in the
'categories' model:

var $hasMany = array(
'Post' => array(
'className' => 'Post',
'foreignKey' => 'category_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);

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


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

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


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


Re: How to Paginate Search Results?

2011-11-01 Thread andrewperk
Thanks guys.

Thank you Andras Kende for recommending that plugin. The Cakedc search
plugin is AMAZING. So easy. I had a bunch of lines of code written
myself to do the search and it was barely working. I exchanged all of
my ugly code out and used like maybe 15 lines of code to implement
that plugin and it works great.

Thanks Cakedc!

Andrew

On Oct 29, 2:15 pm, Andras Kende  wrote:
> You can do it either with PRG (post redirect get) concept:
>
> http://bakery.cakephp.org/articles/luciansabo/2011/08/12/post_redirec...http://cakedc.com/downloads/view/cakephp_search_plugin
>
> or with write the posted form data  to a session once and keep reading it 
> through pagination
>
> something like:
>
>                 if(!empty($this->data['User']['search_name'])) {
>                         $this->Session->write('conditions.firstname', 
> $thisis->data['User']['search_name']);
>                 }
>
>                 if($this->Session->check('conditions')) {
>                         $conditions = $this->Session->read('conditions');
>                 } else {
>                         $conditions = null
>                 }
>
>                 $this->paginate = array(
>                         'recursive' => -1,
>                         'conditions' => $conditions,
>
> Andras Kendehttp://www.kende.com
>
> On Oct 29, 2011, at 1:27 PM, andrewperk wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I've implemented a user model and I have a simple search form for
> > searching by gender, age, location. I'm using the paginator to
> > paginate the results. The problem is that it's only remembering the
> > search criteria on the first page. When I click on page 2, or next
> > etc.. It defaults back to searching all users.
>
> > Here's my dirty search code in my controller, basically it just checks
> > the submitted form fields and does a query on the matching field in
> > the Users table and then paginates the results:
>
> > if (!empty($this->data)) {
> >    // by name
> >    if (!empty($this->data['User']['search_name'])) {
> >    $this->paginate = array('conditions' => array('visible'=>1,
> > 'OR'=>array(
> >            'User.username LIKE' => 
> > '%'.$this->data['User']['search_name'].'%',
> >            'User.firstname LIKE' => '%'.$this->data['User']['search_name'],
> >            'User.lastname LIKE' => '%'.$this->data['User']['search_name'])
> >             ), 'limit'=>'10', 'order'=>'User.username');
> >   }
> >   // by gender
> >   else if (!empty($this->data['User']['search_gender'])) {
> >    $this->paginate = array('conditions' => array(
> >            'visible'=>1,
> >            'User.gender' => $this->data['User']['search_gender']
> >            ), 'limit'=>'10', 'order'=>'User.username');
> >  }
> >  // by state
> >  else if (!empty($this->data['User']['search_state'])) {
> >    $this->paginate = array('conditions' => array(
> >            'visible'=>1,
> >            'User.state' => $this->data['User']['search_state']
> >            ), 'limit'=>'10', 'order'=>'User.username');
> >  }
>
> >   // Send the results for the above criteria to the view
> >   $results = $this->paginate('User');
> >   $this->set('users', $results);
>
> >     }
> >     // Default retrieval of all users
> >    else {
> >    $this->paginate = array('conditions'=>array('visible'=>1),
> > 'limit'=>'10', 'order'=>'User.username');
> >            $this->set('users', $this->paginate('User'));
> >    }
>
> > I'm trying to figure out how to make subsequent pages of the
> > pagination remember my search criteria. Thanks for any help.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

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


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


Re: How to get related username in view?

2011-11-01 Thread Daniel
Yes, you're right 'users' it is not in the 'categories' model.  How do
I get it in the model?  Bear in mind that 'users' are not directly
related to categories.  Here is the relationship that is in the
'categories' model:

var $hasMany = array(
'Post' => array(
'className' => 'Post',
'foreignKey' => 'category_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);

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


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


Re: I hate CLI

2011-11-01 Thread Daniel Luiz Pakuschewski
chmod -r a+rwX webroot/media/transfer

-r lowercase.

On Nov 1, 9:27 am, Jeremy Burns | Class Outfit
 wrote:
> OK - odd. Now I can run the original command:
>
> chmod -R a+rwX webroot/media/transfer
>
> ...so it seems that not running
>
> chmod a+rwX webroot/media/transfer
>
> ... first stopped it from working.
>
> 
>
> Jeremy Burns
> Class Outfit
>
> Tel: +44 (0) 208 123 3822
> Mob: +44 (0) 7973 481949
> Skype: jeremy_burnshttp://www.classoutfit.com
>
> On 1 Nov 2011, at 11:20, Jeremy Burns | Class Outfit wrote:
>
>
>
>
>
>
>
> > chmod a+rwX webroot/media/transfer
>
> > ...runs without error and set the permissions for the media/transfer 
> > directory.
>
> > Jeremy Burns
> > Class Outfit
>
> >http://www.classoutfit.com
>
> > On 1 Nov 2011, at 11:02, Ma'moon wrote:
>
> >> Will you try without -R option
>
> >> On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit 
> >>  wrote:
> >> /Sites/mysitename/app
>
> >> Jeremy Burns
> >> Class Outfit
>
> >>http://www.classoutfit.com
>
> >> On 1 Nov 2011, at 10:33, Ma'moon wrote:
>
> >>> Are you executing the command from the directory that contains the 
> >>> webroot folder?, please run pwd to make sure of the location that you are 
> >>> executing this command from
>
> >>> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit 
> >>>  wrote:
> >>> Running that command from app I get:
>
> >>> chmod: -R: No such file or directory
>
> >>> chmod a+rwX webroot/media/{transfer,filter} -R
>
> >>> ... returns the same result too.
>
> >>> The directories do exist.
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>> Tel: +44 (0) 208 123 3822
> >>> Mob: +44 (0) 7973 481949
> >>> Skype: jeremy_burns
> >>>http://www.classoutfit.com
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>>http://www.classoutfit.com
>
> >>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>
>  try this chmod a+rwX -R webroot/media/{transfer,filter}
>
>  On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns 
>   wrote:
>  I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
>  into a black hole. Give me something I can point at and click and I'm
>  a happy man.
>
>  I'm following the tutorial for setting up David Persson's media
>  plugin. Each time I run this:
>
>  chmod -R a+rwX webroot/media/{transfer,filter}
>
>  ... in Terminal I get this error:
>
>  chmod: Invalid file mode: -R
>
>  I have Googled but can't find the answer. Can any of you CLI junkies
>  help me out please?
>
>  --
>  Our newest site for the community: CakePHP Video 
>  Tutorialshttp://tv.cakephp.org
>  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>  others with their CakePHP related questions.
>
>  To unsubscribe from this group, send email to
>  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>  athttp://groups.google.com/group/cake-php
>
>  --
>  Our newest site for the community: CakePHP Video 
>  Tutorialshttp://tv.cakephp.org
>  Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
>  others with their CakePHP related questions.
>
>  To unsubscribe from this group, send email to
>  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
>  athttp://groups.google.com/group/cake-php
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> >> --
> >> Our newest site for the community: CakePHP Video 
> >> Tutorialshttp://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php
>
> >> --
> >> Our newest site for the community: CakePHP Video 
> >> Tutorialshttp://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest sit

Re: How to get related username in view?

2011-11-01 Thread flo.kl...@googlemail.com
debug() the database result array in your view, then you can check if the User 
data is there. If not you have to check the relationship in your model files. I 
would say there is no or a wrong relationship with the users table.

-flosky



Daniel  schrieb:

I have a categories view which shows related posts that belong to the
category. On the posts table there is a user_id which relates to a
username on the users table. I would like to display the username for
each post on the category view, but when I put $post['User']
['username'] into the ctp file I get an error message: "undefined
index: User"



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


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

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


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


How to get related username in view?

2011-11-01 Thread Daniel
I have a categories view which shows related posts that belong to the
category.  On the posts table there is a user_id which relates to a
username on the users table.  I would like to display the username for
each post on the category view, but when I put $post['User']
['username'] into the ctp file I get an error message: "undefined
index: User"



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


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


Re: Implementing a search functionality

2011-11-01 Thread Yves S. Garret
Ok, one more time!

This is my view:
http://bin.cakephp.org/view/859204807
My model:
http://bin.cakephp.org/view/455436825
My controller:
http://bin.cakephp.org/view/2083728780

Now, what happens is that when I run a search for, say, Smith, the page
just refreshes with all of the stuff as it was.  I inserted debug code
(lines 31 & 32) in the if-statement just to see what was going on and turns
out nothing was going >_>

Should I run this after the pagination?

On Tue, Nov 1, 2011 at 11:29 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> You're right of course. Now if you are American, it would be ironic that
> you understand sarcasm (or irony)!
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 15:22, Jon Bennett wrote:
>
> I hope we all know that I was being ironic. ^^
>
>
> Don't think that's irony, more sarcasm ;)
>
> j
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Why the brackets/single-quotes around tables and columns?

2011-11-01 Thread mark_story
To be a nitpick, those are backticks not single quotes.  Identifier
quoting is different in every database vendor. So Cake adjusts
accordingly.

-Mark

On Nov 1, 11:16 am, "Yves S. Garret" 
wrote:
> I'm connecting to an MS-SQL database.  And, although I can't show you the
> tables and exact columns (I can show you something similar), I've noticed
> the following output at the bottom of my page.
>
> SELECT [Post].[id], [Post].[title], [Post].[body], [Post].[created],
> [Post].[modified] FROM [posts] AS [Post] WHERE 1 = 1
>
> Why the brackets?
>
> When I'm connecting to a MySQL database, I get single-quotes.
>
> SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`,
> `Post`.`modified` FROM `posts` AS `Post` WHERE 1 = 1
>
> Why the single quotes for a MySQL DB?

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


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


Re: ACL is not working for groups

2011-11-01 Thread sixthpoint
awesome response time :) thanks!

On Nov 1, 11:05 am, sixthpoint  wrote:
> I am having this exact same error, let me know if you find a solution.
>
> On Oct 31, 12:23 pm, warLog  wrote:
>
>
>
>
>
>
>
> > I want to utilise the concept of groups in ACL. I am very new to
> > cakephp, and messed up with ACL. My database tables are as follows:
> > CREATE TABLE IF NOT EXISTS `gcfa_groups` (
> >   `id` int(11) NOT NULL AUTO_INCREMENT,
> >   `name` varchar(255) NOT NULL,
> >   PRIMARY KEY (`id`)
> > );
>
> > CREATE TABLE IF NOT EXISTS `gcfa_users` (
> >   `id` int(11) NOT NULL AUTO_INCREMENT,
> >   `password` varchar(50) NOT NULL,
> >   `active` tinyint(4) NOT NULL DEFAULT '1',
> >   `email` varchar(255) DEFAULT NULL,
> >   `group_id` int(11) NOT NULL,
> >   `name` varchar(100) NOT NULL,
> >   PRIMARY KEY (`id`)
> > );
>
> > id is being used as username.
>
> > My model files are as follows:
> > class User extends AppModel {
> >         var $name = 'User';
>
> >         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
> >         var $belongsTo = array(
> >                                         'Group' => array('className' => 
> > 'Group',
> >                                                                 
> > 'foreignKey' => 'group_id'
> >                                         )
> >                                 );
> >         public $actsAs = array('Acl' => array('type' => 'requester'));
>
> >         public function parentNode() {
> >                 if (!$this->id && empty($this->data)) {
> >                 return null;
> >             }
> >             $data = $this->data;
> >             if (empty($this->data) || 
> > empty($this->data['User']['group_id']))
> > {
> >                 $data = $this->read();
> >             }
>
> >             if (!$data['User']['group_id']) {
> >                 return null;
> >             } else {
> >                 $this->Group->id = $data['User']['group_id'];
> >                         $groupNode = $this->Group->node();
> >                         return array('Group' => array('id' => 
> > $groupNode[0]['Aro']
> > ['foreign_key']));
> >             }
> >         }
>
> >         public function bindNode($object) {
> >                 if (!empty($object[$this->alias]['group_id'])) {
> >                         return array('model' => 'Group', 'foreign_key' => 
> > $object[$this->alias]['group_id']);
>
> >                 }
> >         }
>
> >         function isAuthorized($user, $controller, $action) {
> >                 return true;
> >         }
>
> > }
>
> > class Group extends AppModel {
> >         public $displayField = 'name';
> >         var $hasMany = array('User');
>
> >         public $actsAs = array('Acl' => array('requester'));
>
> >         public function parentNode() {
> >                 return null;
> >         }
>
> > }
>
> > I just baked the controller and view files for these models using
> > shell. I have setup my ACL as follows:
> > id      parent_id       model   foreign_key     alias   lft     rght
> > 1       NULL    Group   1       SuperUser       1       2
> > 2       NULL    Group   2       Administrator   3       4
> > 3       NULL    Group   3       Manager                 5       6
> > 4       NULL    Group   4       Author          7       8
>
> > Whenever I am going to edit any user it is giving me error :
> > Warning (512): AclNode::node() - Couldn't find Aro node identified by
> > "Array
> > (
> >     [Aro0.model] => User
> >     [Aro0.foreign_key] => 2
> > )
> > " [CORE/Cake/Model/AclNode.php, line 179]
>
> > Do I need to make separate entry of every user in aros table? If yes,
> > then what is the use of groups in this case? If I want to bypass this
> > creation of new entry in acos table, is it possible? I think if I am
> > able to override AclBehaviour::afterSave method then I can do that.
> > I dont want to create a separate entry for every user in the ACL.

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


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


Re: ACL is not working for groups

2011-11-01 Thread sixthpoint
I am having this exact same error, let me know if you find a solution.

On Oct 31, 12:23 pm, warLog  wrote:
> I want to utilise the concept of groups in ACL. I am very new to
> cakephp, and messed up with ACL. My database tables are as follows:
> CREATE TABLE IF NOT EXISTS `gcfa_groups` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `name` varchar(255) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> CREATE TABLE IF NOT EXISTS `gcfa_users` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `password` varchar(50) NOT NULL,
>   `active` tinyint(4) NOT NULL DEFAULT '1',
>   `email` varchar(255) DEFAULT NULL,
>   `group_id` int(11) NOT NULL,
>   `name` varchar(100) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> id is being used as username.
>
> My model files are as follows:
> class User extends AppModel {
>         var $name = 'User';
>
>         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
>         var $belongsTo = array(
>                                         'Group' => array('className' => 
> 'Group',
>                                                                 'foreignKey' 
> => 'group_id'
>                                         )
>                                 );
>         public $actsAs = array('Acl' => array('type' => 'requester'));
>
>         public function parentNode() {
>                 if (!$this->id && empty($this->data)) {
>                 return null;
>             }
>             $data = $this->data;
>             if (empty($this->data) || empty($this->data['User']['group_id']))
> {
>                 $data = $this->read();
>             }
>
>             if (!$data['User']['group_id']) {
>                 return null;
>             } else {
>                 $this->Group->id = $data['User']['group_id'];
>                         $groupNode = $this->Group->node();
>                         return array('Group' => array('id' => 
> $groupNode[0]['Aro']
> ['foreign_key']));
>             }
>         }
>
>         public function bindNode($object) {
>                 if (!empty($object[$this->alias]['group_id'])) {
>                         return array('model' => 'Group', 'foreign_key' => 
> $object[$this->alias]['group_id']);
>
>                 }
>         }
>
>         function isAuthorized($user, $controller, $action) {
>                 return true;
>         }
>
> }
>
> class Group extends AppModel {
>         public $displayField = 'name';
>         var $hasMany = array('User');
>
>         public $actsAs = array('Acl' => array('requester'));
>
>         public function parentNode() {
>                 return null;
>         }
>
> }
>
> I just baked the controller and view files for these models using
> shell. I have setup my ACL as follows:
> id      parent_id       model   foreign_key     alias   lft     rght
> 1       NULL    Group   1       SuperUser       1       2
> 2       NULL    Group   2       Administrator   3       4
> 3       NULL    Group   3       Manager                 5       6
> 4       NULL    Group   4       Author          7       8
>
> Whenever I am going to edit any user it is giving me error :
> Warning (512): AclNode::node() - Couldn't find Aro node identified by
> "Array
> (
>     [Aro0.model] => User
>     [Aro0.foreign_key] => 2
> )
> " [CORE/Cake/Model/AclNode.php, line 179]
>
> Do I need to make separate entry of every user in aros table? If yes,
> then what is the use of groups in this case? If I want to bypass this
> creation of new entry in acos table, is it possible? I think if I am
> able to override AclBehaviour::afterSave method then I can do that.
> I dont want to create a separate entry for every user in the ACL.

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


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


Re: ACL is not working for groups

2011-11-01 Thread warLog
Finally I got the solution. Just put following line in User model:
public $actsAs = array('Acl' => array('type' => 'requester', 'enabled'
=> false));

On Oct 31, 10:23 pm, warLog  wrote:
> I want to utilise the concept of groups in ACL. I am very new to
> cakephp, and messed up with ACL. My database tables are as follows:
> CREATE TABLE IF NOT EXISTS `gcfa_groups` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `name` varchar(255) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> CREATE TABLE IF NOT EXISTS `gcfa_users` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `password` varchar(50) NOT NULL,
>   `active` tinyint(4) NOT NULL DEFAULT '1',
>   `email` varchar(255) DEFAULT NULL,
>   `group_id` int(11) NOT NULL,
>   `name` varchar(100) NOT NULL,
>   PRIMARY KEY (`id`)
> );
>
> id is being used as username.
>
> My model files are as follows:
> class User extends AppModel {
>         var $name = 'User';
>
>         var $hasMany = array('UserBank', 'UserNominee', 'Payment');
>         var $belongsTo = array(
>                                         'Group' => array('className' => 
> 'Group',
>                                                                 'foreignKey' 
> => 'group_id'
>                                         )
>                                 );
>         public $actsAs = array('Acl' => array('type' => 'requester'));
>
>         public function parentNode() {
>                 if (!$this->id && empty($this->data)) {
>                 return null;
>             }
>             $data = $this->data;
>             if (empty($this->data) || empty($this->data['User']['group_id']))
> {
>                 $data = $this->read();
>             }
>
>             if (!$data['User']['group_id']) {
>                 return null;
>             } else {
>                 $this->Group->id = $data['User']['group_id'];
>                         $groupNode = $this->Group->node();
>                         return array('Group' => array('id' => 
> $groupNode[0]['Aro']
> ['foreign_key']));
>             }
>         }
>
>         public function bindNode($object) {
>                 if (!empty($object[$this->alias]['group_id'])) {
>                         return array('model' => 'Group', 'foreign_key' => 
> $object[$this->alias]['group_id']);
>
>                 }
>         }
>
>         function isAuthorized($user, $controller, $action) {
>                 return true;
>         }
>
> }
>
> class Group extends AppModel {
>         public $displayField = 'name';
>         var $hasMany = array('User');
>
>         public $actsAs = array('Acl' => array('requester'));
>
>         public function parentNode() {
>                 return null;
>         }
>
> }
>
> I just baked the controller and view files for these models using
> shell. I have setup my ACL as follows:
> id      parent_id       model   foreign_key     alias   lft     rght
> 1       NULL    Group   1       SuperUser       1       2
> 2       NULL    Group   2       Administrator   3       4
> 3       NULL    Group   3       Manager                 5       6
> 4       NULL    Group   4       Author          7       8
>
> Whenever I am going to edit any user it is giving me error :
> Warning (512): AclNode::node() - Couldn't find Aro node identified by
> "Array
> (
>     [Aro0.model] => User
>     [Aro0.foreign_key] => 2
> )
> " [CORE/Cake/Model/AclNode.php, line 179]
>
> Do I need to make separate entry of every user in aros table? If yes,
> then what is the use of groups in this case? If I want to bypass this
> creation of new entry in acos table, is it possible? I think if I am
> able to override AclBehaviour::afterSave method then I can do that.
> I dont want to create a separate entry for every user in the ACL.

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


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


Re: Implementing a search functionality

2011-11-01 Thread Jeremy Burns | Class Outfit
You're right of course. Now if you are American, it would be ironic that you 
understand sarcasm (or irony)!

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 15:22, Jon Bennett wrote:

>> I hope we all know that I was being ironic. ^^
> 
> Don't think that's irony, more sarcasm ;)
> 
> j
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread Jon Bennett
> I hope we all know that I was being ironic. ^^

Don't think that's irony, more sarcasm ;)

j

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


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


Re: Why the brackets/single-quotes around tables and columns?

2011-11-01 Thread Jeremy Burns | Class Outfit
Because that's how MS-SQL rolls.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 15:16, Yves S. Garret wrote:

> I'm connecting to an MS-SQL database.  And, although I can't show you the 
> tables and exact columns (I can show you something similar), I've noticed the 
> following output at the bottom of my page.
> 
> SELECT [Post].[id], [Post].[title], [Post].[body], [Post].[created], 
> [Post].[modified] FROM [posts] AS [Post] WHERE 1 = 1
> 
> Why the brackets?
> 
> When I'm connecting to a MySQL database, I get single-quotes.
> 
> SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`, 
> `Post`.`modified` FROM `posts` AS `Post` WHERE 1 = 1
> 
> Why the single quotes for a MySQL DB?
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Why the brackets/single-quotes around tables and columns?

2011-11-01 Thread Yves S. Garret
I'm connecting to an MS-SQL database.  And, although I can't show you the
tables and exact columns (I can show you something similar), I've noticed
the following output at the bottom of my page.

SELECT [Post].[id], [Post].[title], [Post].[body], [Post].[created],
[Post].[modified] FROM [posts] AS [Post] WHERE 1 = 1

Why the brackets?

When I'm connecting to a MySQL database, I get single-quotes.

SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`, `Post`.`created`,
`Post`.`modified` FROM `posts` AS `Post` WHERE 1 = 1

Why the single quotes for a MySQL DB?

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


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


Re: Implementing a search functionality

2011-11-01 Thread Yves S. Garret
It would've worked better if there indeed wasn't a Joogle out there :-) .

On Tue, Nov 1, 2011 at 1:31 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> I hope we all know that I was being ironic. ^^
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 03:48, Yves wrote:
>
> There actually is a search engine plugin called joogle.
>
> On Oct 31, 2011, at 11:20 PM, Ryan Schmidt 
> wrote:
>
>
> On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote:
>
>
> I didn't search there. I used another little know search engine called
> Joogle (or something like that):
>
>
> You probably meant "Google".
>
>
>
> --
>
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
>
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
>
> To unsubscribe from this group, send email to
>
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: I hate CLI

2011-11-01 Thread Jeremy Burns | Class Outfit
OK - odd. Now I can run the original command:

chmod -R a+rwX webroot/media/transfer

...so it seems that not running

chmod a+rwX webroot/media/transfer

... first stopped it from working.



Jeremy Burns
Class Outfit

Tel: +44 (0) 208 123 3822
Mob: +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com

On 1 Nov 2011, at 11:20, Jeremy Burns | Class Outfit wrote:

> chmod a+rwX webroot/media/transfer
> 
> ...runs without error and set the permissions for the media/transfer 
> directory.
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 1 Nov 2011, at 11:02, Ma'moon wrote:
> 
>> Will you try without -R option
>> 
>> On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit 
>>  wrote:
>> /Sites/mysitename/app
>> 
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> http://www.classoutfit.com
>> 
>> On 1 Nov 2011, at 10:33, Ma'moon wrote:
>> 
>>> Are you executing the command from the directory that contains the webroot 
>>> folder?, please run pwd to make sure of the location that you are executing 
>>> this command from
>>> 
>>> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit 
>>>  wrote:
>>> Running that command from app I get:
>>> 
>>> chmod: -R: No such file or directory
>>> 
>>> chmod a+rwX webroot/media/{transfer,filter} -R
>>> 
>>> ... returns the same result too.
>>> 
>>> The directories do exist.
>>> 
>>> Jeremy Burns
>>> Class Outfit
>>> 
>>> Tel: +44 (0) 208 123 3822
>>> Mob: +44 (0) 7973 481949
>>> Skype: jeremy_burns
>>> http://www.classoutfit.com
>>> 
>>> 
>>> Jeremy Burns
>>> Class Outfit
>>> 
>>> http://www.classoutfit.com
>>> 
>>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>>> 
 try this chmod a+rwX -R webroot/media/{transfer,filter}
 
 On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns 
  wrote:
 I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
 into a black hole. Give me something I can point at and click and I'm
 a happy man.
 
 I'm following the tutorial for setting up David Persson's media
 plugin. Each time I run this:
 
 chmod -R a+rwX webroot/media/{transfer,filter}
 
 ... in Terminal I get this error:
 
 chmod: Invalid file mode: -R
 
 I have Googled but can't find the answer. Can any of you CLI junkies
 help me out please?
 
 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
 
 
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 at http://groups.google.com/group/cake-php
 
 
 -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 at http://groups.google.com/group/cake-php
>>> 
>>> 
>>> -- 
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org 
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>>  
>>>  
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>>> 
>>> 
>>> -- 
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org 
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>>  
>>>  
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.

Re: I hate CLI

2011-11-01 Thread Ma'moon
Command line is very powerful, you just need to know how to use it and once
you got used to it you will never like doing anything out of command line.
You're welcome!

On Tue, Nov 1, 2011 at 1:20 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> chmod a+rwX webroot/media/transfer
>
> ...runs without error and set the permissions for the media/transfer
> directory.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 11:02, Ma'moon wrote:
>
> Will you try without -R option
>
> On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> /Sites/mysitename/app
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 1 Nov 2011, at 10:33, Ma'moon wrote:
>>
>> Are you executing the command from the directory that contains the
>> webroot folder?, please run pwd to make sure of the location that you are
>> executing this command from
>>
>> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> Running that command from app I get:
>>>
>>> chmod: -R: No such file or directory
>>>
>>> chmod a+rwX webroot/media/{transfer,filter} -R
>>>
>>> ... returns the same result too.
>>>
>>> The directories do exist.
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> Tel: +44 (0) 208 123 3822
>>> Mob: +44 (0) 7973 481949
>>> Skype: jeremy_burns
>>> http://www.classoutfit.com
>>>
>>>
>>> Jeremy Burns
>>> Class Outfit
>>>
>>> http://www.classoutfit.com
>>>
>>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>>>
>>> try this chmod a+rwX -R webroot/media/{transfer,filter}
>>>
>>> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns <
>>> jeremybu...@classoutfit.com> wrote:
>>>
 I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
 into a black hole. Give me something I can point at and click and I'm
 a happy man.

 I'm following the tutorial for setting up David Persson's media
 plugin. Each time I run this:

 chmod -R a+rwX webroot/media/{transfer,filter}

 ... in Terminal I get this error:

 chmod: Invalid file mode: -R

 I have Googled but can't find the answer. Can any of you CLI junkies
 help me out please?

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


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

>>>
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>>
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@go

Re: I hate CLI

2011-11-01 Thread Jeremy Burns | Class Outfit
chmod a+rwX webroot/media/transfer

...runs without error and set the permissions for the media/transfer directory.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 11:02, Ma'moon wrote:

> Will you try without -R option
> 
> On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit 
>  wrote:
> /Sites/mysitename/app
> 
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 1 Nov 2011, at 10:33, Ma'moon wrote:
> 
>> Are you executing the command from the directory that contains the webroot 
>> folder?, please run pwd to make sure of the location that you are executing 
>> this command from
>> 
>> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit 
>>  wrote:
>> Running that command from app I get:
>> 
>> chmod: -R: No such file or directory
>> 
>> chmod a+rwX webroot/media/{transfer,filter} -R
>> 
>> ... returns the same result too.
>> 
>> The directories do exist.
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> Tel: +44 (0) 208 123 3822
>> Mob: +44 (0) 7973 481949
>> Skype: jeremy_burns
>> http://www.classoutfit.com
>> 
>> 
>> Jeremy Burns
>> Class Outfit
>> 
>> http://www.classoutfit.com
>> 
>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>> 
>>> try this chmod a+rwX -R webroot/media/{transfer,filter}
>>> 
>>> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns  
>>> wrote:
>>> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
>>> into a black hole. Give me something I can point at and click and I'm
>>> a happy man.
>>> 
>>> I'm following the tutorial for setting up David Persson's media
>>> plugin. Each time I run this:
>>> 
>>> chmod -R a+rwX webroot/media/{transfer,filter}
>>> 
>>> ... in Terminal I get this error:
>>> 
>>> chmod: Invalid file mode: -R
>>> 
>>> I have Googled but can't find the answer. Can any of you CLI junkies
>>> help me out please?
>>> 
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>> 
>>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>>> 
>>> 
>>> -- 
>>> Our newest site for the community: CakePHP Video Tutorials 
>>> http://tv.cakephp.org 
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>>> others with their CakePHP related questions.
>>>  
>>>  
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: I hate CLI

2011-11-01 Thread Ma'moon
Will you try without -R option

On Tue, Nov 1, 2011 at 12:38 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> /Sites/mysitename/app
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 10:33, Ma'moon wrote:
>
> Are you executing the command from the directory that contains the webroot
> folder?, please run pwd to make sure of the location that you are executing
> this command from
>
> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit <
> jeremybu...@classoutfit.com> wrote:
>
>> Running that command from app I get:
>>
>> chmod: -R: No such file or directory
>>
>> chmod a+rwX webroot/media/{transfer,filter} -R
>>
>> ... returns the same result too.
>>
>> The directories do exist.
>>
>> Jeremy Burns
>> Class Outfit
>>
>> Tel: +44 (0) 208 123 3822
>> Mob: +44 (0) 7973 481949
>> Skype: jeremy_burns
>> http://www.classoutfit.com
>>
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>>
>> try this chmod a+rwX -R webroot/media/{transfer,filter}
>>
>> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns <
>> jeremybu...@classoutfit.com> wrote:
>>
>>> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
>>> into a black hole. Give me something I can point at and click and I'm
>>> a happy man.
>>>
>>> I'm following the tutorial for setting up David Persson's media
>>> plugin. Each time I run this:
>>>
>>> chmod -R a+rwX webroot/media/{transfer,filter}
>>>
>>> ... in Terminal I get this error:
>>>
>>> chmod: Invalid file mode: -R
>>>
>>> I have Googled but can't find the answer. Can any of you CLI junkies
>>> help me out please?
>>>
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions site http://ask.cakephp.org and
>>> help others with their CakePHP related questions.
>>>
>>>
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this
>>> group at http://groups.google.com/group/cake-php
>>>
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>>
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Making radio button labels clickable?

2011-11-01 Thread dave
Thanks Ryan, I did wonder that before posting my issue yesterday...I
previously prefixed the 1 and 2 with 'reply', so the ids were reply1
and reply2, but to no avail... the code is below, the only change
being the prefix of 'reply' in the array creation. Please note, I've
reverted to the actual reply codes for male and female, 2520 and 2530
respectively, in place of 1 and 2, because I'm a little bemused by the
id cake has now given the inputs (see a little lower), guessing they
depend on the values in the $options array somehow? Where does the Pl
of MemberGenderPl come from? And why?:

$options = array();
$c = 0;
while ($c < count($question['Reply'])) {
$options['reply'.$question['Reply'][$c]['id']] = $question['Reply']
[$c]['value'];
$c++;
}

echo $this->Form->input($question['Question']['name'], array(
'type' => 'radio',
'class' => 'list required',
'options' => $options
));

For info, the $options array looks like this after it's created:

Array ( [reply2520] => Male [reply2530] => Female )

This gives me:


Male

Female

Obviously I can see that the $options array value reply2520 and
reply2530 are now set as the value of the inputs.

What I'm trying to achieve (with the real values of 2520 and 2530
instead of 1 and 2, and non-numeric ids) is this:


Male

Female

Any further help would be great...I just want the ux to be correct, by
the labels being clickable :/. This kind of thing is absolutely
straightforward without using cake $this->Form->input(s), but then I
lose the benefit of the save functionality etc...and I really wanna
get to the bottom of this. Loving cake in all respects except this.
Still think the issue is in the array - any advice anyone please?? I'm
thinking should the array read something like:

Array ( Array( [id] => reply2520, [value] => Male, [for] =>
reply2520), Array( [id] => reply2530, [value] => Female, [for] =>
reply2530)  )

but tried various versions of this without getting there...pretty sure
'for' is not correct for instance...etc etc. Tried lots of things
prior to posting here...and checked all documentation and other user's
issues etc, but no definitive answer, Surely it can't be that tricky?
Flummoxed...

Thanks in advance...

Dave



On Nov 1, 3:22 am, Ryan Schmidt  wrote:
> On Oct 31, 2011, at 11:29, dave wrote:
>
> > What I want to achieve:
>
> >  > name="data[Member][gender]">
> > Male
> >  > name="data[Member][gender]">
> > Female
>
> For the record, "1" and "2" are not valid HTML IDs. IDs must begin with a 
> letter. Some browsers enforce this.

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


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


Re: I hate CLI

2011-11-01 Thread Jeremy Burns | Class Outfit
/Sites/mysitename/app

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 10:33, Ma'moon wrote:

> Are you executing the command from the directory that contains the webroot 
> folder?, please run pwd to make sure of the location that you are executing 
> this command from
> 
> On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit 
>  wrote:
> Running that command from app I get:
> 
> chmod: -R: No such file or directory
> 
> chmod a+rwX webroot/media/{transfer,filter} -R
> 
> ... returns the same result too.
> 
> The directories do exist.
> 
> Jeremy Burns
> Class Outfit
> 
> Tel: +44 (0) 208 123 3822
> Mob: +44 (0) 7973 481949
> Skype: jeremy_burns
> http://www.classoutfit.com
> 
> 
> Jeremy Burns
> Class Outfit
> 
> http://www.classoutfit.com
> 
> On 1 Nov 2011, at 10:02, Ma'moon wrote:
> 
>> try this chmod a+rwX -R webroot/media/{transfer,filter}
>> 
>> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns  
>> wrote:
>> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
>> into a black hole. Give me something I can point at and click and I'm
>> a happy man.
>> 
>> I'm following the tutorial for setting up David Persson's media
>> plugin. Each time I run this:
>> 
>> chmod -R a+rwX webroot/media/{transfer,filter}
>> 
>> ... in Terminal I get this error:
>> 
>> chmod: Invalid file mode: -R
>> 
>> I have Googled but can't find the answer. Can any of you CLI junkies
>> help me out please?
>> 
>> --
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>> 
>> 
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
>> 
>> 
>> -- 
>> Our newest site for the community: CakePHP Video Tutorials 
>> http://tv.cakephp.org 
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
>> others with their CakePHP related questions.
>>  
>>  
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: I hate CLI

2011-11-01 Thread Ma'moon
Are you executing the command from the directory that contains the webroot
folder?, please run pwd to make sure of the location that you are executing
this command from

On Tue, Nov 1, 2011 at 12:24 PM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Running that command from app I get:
>
> chmod: -R: No such file or directory
>
> chmod a+rwX webroot/media/{transfer,filter} -R
>
> ... returns the same result too.
>
> The directories do exist.
>
> Jeremy Burns
> Class Outfit
>
> Tel: +44 (0) 208 123 3822
> Mob: +44 (0) 7973 481949
> Skype: jeremy_burns
> http://www.classoutfit.com
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 10:02, Ma'moon wrote:
>
> try this chmod a+rwX -R webroot/media/{transfer,filter}
>
> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns  > wrote:
>
>> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
>> into a black hole. Give me something I can point at and click and I'm
>> a happy man.
>>
>> I'm following the tutorial for setting up David Persson's media
>> plugin. Each time I run this:
>>
>> chmod -R a+rwX webroot/media/{transfer,filter}
>>
>> ... in Terminal I get this error:
>>
>> chmod: Invalid file mode: -R
>>
>> I have Googled but can't find the answer. Can any of you CLI junkies
>> help me out please?
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>> at http://groups.google.com/group/cake-php
>>
>
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>
>
>  --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: I hate CLI

2011-11-01 Thread Jeremy Burns | Class Outfit
Running that command from app I get:

chmod: -R: No such file or directory

chmod a+rwX webroot/media/{transfer,filter} -R

... returns the same result too.

The directories do exist.

Jeremy Burns
Class Outfit

Tel: +44 (0) 208 123 3822
Mob: +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 10:02, Ma'moon wrote:

> try this chmod a+rwX -R webroot/media/{transfer,filter}
> 
> On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns  
> wrote:
> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
> into a black hole. Give me something I can point at and click and I'm
> a happy man.
> 
> I'm following the tutorial for setting up David Persson's media
> plugin. Each time I run this:
> 
> chmod -R a+rwX webroot/media/{transfer,filter}
> 
> ... in Terminal I get this error:
> 
> chmod: Invalid file mode: -R
> 
> I have Googled but can't find the answer. Can any of you CLI junkies
> help me out please?
> 
> --
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php
> 
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
>  
>  
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


Re: Why specify the controller in the view?

2011-11-01 Thread euromark
for me its clearly laziness or better "huriness"
specifying links in the same controller this way can happen if you are
short in time :)
typing controller=>xyz a few dozen times just needs its time.
but yes, one should take it^^


On 1 Nov., 10:38, Jeremy Burns | Class Outfit
 wrote:
> I think it has more to do with belt and braces than laziness. I always add 
> the controller because I want to be sure it goes where I want it to go, 
> rather than letting Cake (potentially) decide for me.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 09:21, WebbedIT wrote:
>
>
>
>
>
>
>
> > It's not lazyness per se, both are completely valid and it's up to you
> > to decide which to use in what circumstances.  If you are 100% certain
> > that the view containing the link will only ever be called from a
> > certain controller, then you do not need to include that controller in
> > the url array as the controller being used at the time will be
> > inserted.
>
> > There are many different ways to specify arguments/params for most
> > functions ... just learn all of those ways and use the right one for
> > you in the right circumstances.
>
> > HTH, Paul
>
> > On Oct 31, 8:12 pm, "Yves S. Garret" 
> > wrote:
> >> I got a pet peeve about being 'lazy' :-) .  Too often it leaves vague code
> >> that some poor soul needs to update years after the fact, with little
> >> understanding of what's going on.
>
> >> I'll specify the exact controller.
>
> >> On Mon, Oct 31, 2011 at 3:41 PM, euromark 
> >> wrote:
>
> >>> both will work exactly the same WITHIN the controller
> >>> you may leave it out in this case.
> >>> its always good practice to specify the controller, as well, though.
>
> >>> but if you are outside of this controller you MUST specify it
> >>> so better include it everywhere. especially if you move code around
> >>> (copy and paste)
> >>> or if you make it an element (which could be included in any other
> >>> view/controller/layout.
>
> >>> so better safe than sry :)
> >>> we programmers are just lazy sometimes
>
> >>> On 31 Okt., 20:28, "Yves S. Garret" 
> >>> wrote:
>  I just noticed this in the cakephp book.  In the first example, you have
>  the following line(s) in index.ctp:
>
> http://book.cakephp.org/view/1536/Creating-Post-Views
>
>  Html->link($post['Post']['title'], array('controller'
> >>> =>
>  'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the
>  first example of a view
>
> http://book.cakephp.org/view/1540/Editing-Posts
>
>  Html->link($post['Post']['title'], array('action' =>
>  'view', $post['Post']['id']));?>  <--- this is a later example, when
> >>> you're
>  editing the post.
>
>  The question is about this line: 'controller' => 'posts' <--- this
> >>> doesn't
>  seem to affect the way info is posted.  index.ctp is already tied to the
>  index method in the PostsController, so what role does this play?
>
> >>> --
> >>> Our newest site for the community: CakePHP Video Tutorials
> >>>http://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> >>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

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


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


Re: I hate CLI

2011-11-01 Thread Ma'moon
try this chmod a+rwX -R webroot/media/{transfer,filter}

On Tue, Nov 1, 2011 at 11:26 AM, Jeremy Burns
wrote:

> I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
> into a black hole. Give me something I can point at and click and I'm
> a happy man.
>
> I'm following the tutorial for setting up David Persson's media
> plugin. Each time I run this:
>
> chmod -R a+rwX webroot/media/{transfer,filter}
>
> ... in Terminal I get this error:
>
> chmod: Invalid file mode: -R
>
> I have Googled but can't find the answer. Can any of you CLI junkies
> help me out please?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


We need a Cake/PHP Expert for a Project

2011-11-01 Thread WTH
Hello,

Are you a Cake/PHP expert?  Looking for a challenging project with a
great company?

We have a penny auction site that we need help with.  The first
project will include helping us implement a caching solution
(memcached) that will allow our app to scale across multiple app
servers.  It runs pretty well today on one app server, but with our
growth, we need this to scale to additional servers.

If you know mysql, that's a bonus.

Must be US based.
Must be a Cake/PHP expert.

If you are interested, please respond to ad...@winthehunt.com.

We have multiple projects in our plan.  If the first project goes
well, there will be many more.

Thank You!

Dave

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


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


Re: query

2011-11-01 Thread Jeremy Burns | Class Outfit
+1

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 09:43, WebbedIT wrote:

> @Chris: Please no, not another person advocating the use of $this-
>> query()!  Although this one is really special as anytime you join two
> models you give up and revert to running your own SQL?!?
> 
> Just because you can't get your head around associating models
> together and running Model::find (should get your head around
> containable too) does not mean you should recommend to others early in
> the learning curve to follow your cop-out path.
> 
> There are so many reasons to learn how to use Cake properly and it
> certainly does not make life harder, in fact you could not be further
> from the truth.  OK there are some circumstances where you need to
> learn how to leverage Model::find a little, but these are very few and
> far between and the benefits of having your data arrays passed back in
> a manner that the Form helper and Model::save expects them in saves
> you a ton of time.
> 
> Please go back to the book and take the time to learn it and don't
> advise others to give up on it.
> 
> Paul.
> 
> On Oct 31, 9:07 am, Chris Cinelli
>  wrote:
>> We have complicated queries that span across 8 tables. We decided to use
>> pure SQL code. We defined our data source and run SQL through it defining
>> our custom methods in the model that execute the query. If the query is
>> just on one table we use the ORM but pure SQL pretty much in the other
>> cases. The purpouse of the ORM layer is to make things easier. If you make
>> it  more complicated, why are you doing it?
>> On Oct 31, 2011 1:55 AM, "WebbedIT"  wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Without seeing any of your code (model associations would have been
>>> nice) I logically assume you are using Article HABTM Tag.
>> 
>>> If so this does not create a model for the join table, but instead
>>> puts in place some automagic to allow you to link many-to-many records
>>> between the two models.  As such you can't run a find on the join
>>> model, which is what you would have to do to be able to have
>>> conditions spanning the three tables.
>> 
>>> Your options are to use unbind and bind to force joins that you can
>>> use:
>> 
>>> http://nuts-and-bolts-of-cakephp.com/2008/08/06/habtm-and-join-tricke...
>> 
>>> Or, my preferred option is to create a model for join tables
>> 
>>> Article hasMany ArticleTag
>>> Tag hasMany ArticleTag
>>> ArticleTag belongsTo Article, Tag
>> 
>>> This allows you to easily add extra fields into your join table and to
>>> run $this->Article->ArticleTag->find('all', array('conditions'=>array(
>>>  'Article.is_read'=>0,
>>>  'Article.status'=>1,
>>>  'Tag.name'=>'cakephp'
>>> )));
>> 
>>> HTH, Paul.
>> 
>>> P.S. Notice how I have changed some of your field names and values.
>>> Your isRead field should be lowercased and underscored and if boolen
>>> use tinyint(1) with 0 and 1.  When searching for articles by tag you
>>> would normally recieve the tagname in the request (much better for
>>> seo) so to query by Tag.id would require an extra find that I would
>>> say is unneccessary when you can filter by Tag.name (especially if you
>>> have the name field unique indexed).  I would also switch
>>> Article.status for numerical values, ideally with a lookup table so
>>> you can easily add/edit status text across all articles.
>> 
>>> On Oct 30, 8:50 am, SERKAN TURAN  wrote:
 Hi,
 I have an query and I could not figure it out what is the cakephp form of
 it.
>> 
 query:
 ---
 SELECT *
 FROM
   tags`
   INNER JOIN `tags_articles` ON (`tags`.`id` = `tags_articles`.`tag_id`)
   INNER JOIN `articles` ON (`tags_articles`.`article_id` =
>>> `articles`.`id`)
 WHERE
   `articles`.`isRead` = 'Not' AND
   `tags`.`id` = 3 AND
   `articles`.`status` = 'New'
 ORDER BY
   `articles`.`name` DESC
>> 
>>> ---
>>> ---
>> 
 Thnks..
 ST
>> 
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http:/

Re: Why specify the controller in the view?

2011-11-01 Thread AD7six


On Oct 31, 9:12 pm, "Yves S. Garret" 
wrote:
> I got a pet peeve about being 'lazy' :-) .

How are default values lazy or vague?

If you're allergic to default values being absent - don't forget to
type them all out Yves. I'm sure the successive poor soul will
appreciate the verbosity.

AD

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


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


Re: query

2011-11-01 Thread WebbedIT
@Chris: Please no, not another person advocating the use of $this-
>query()!  Although this one is really special as anytime you join two
models you give up and revert to running your own SQL?!?

Just because you can't get your head around associating models
together and running Model::find (should get your head around
containable too) does not mean you should recommend to others early in
the learning curve to follow your cop-out path.

There are so many reasons to learn how to use Cake properly and it
certainly does not make life harder, in fact you could not be further
from the truth.  OK there are some circumstances where you need to
learn how to leverage Model::find a little, but these are very few and
far between and the benefits of having your data arrays passed back in
a manner that the Form helper and Model::save expects them in saves
you a ton of time.

Please go back to the book and take the time to learn it and don't
advise others to give up on it.

Paul.

On Oct 31, 9:07 am, Chris Cinelli
 wrote:
> We have complicated queries that span across 8 tables. We decided to use
> pure SQL code. We defined our data source and run SQL through it defining
> our custom methods in the model that execute the query. If the query is
> just on one table we use the ORM but pure SQL pretty much in the other
> cases. The purpouse of the ORM layer is to make things easier. If you make
> it  more complicated, why are you doing it?
> On Oct 31, 2011 1:55 AM, "WebbedIT"  wrote:
>
>
>
>
>
>
>
> > Without seeing any of your code (model associations would have been
> > nice) I logically assume you are using Article HABTM Tag.
>
> > If so this does not create a model for the join table, but instead
> > puts in place some automagic to allow you to link many-to-many records
> > between the two models.  As such you can't run a find on the join
> > model, which is what you would have to do to be able to have
> > conditions spanning the three tables.
>
> > Your options are to use unbind and bind to force joins that you can
> > use:
>
> >http://nuts-and-bolts-of-cakephp.com/2008/08/06/habtm-and-join-tricke...
>
> > Or, my preferred option is to create a model for join tables
>
> > Article hasMany ArticleTag
> > Tag hasMany ArticleTag
> > ArticleTag belongsTo Article, Tag
>
> > This allows you to easily add extra fields into your join table and to
> > run $this->Article->ArticleTag->find('all', array('conditions'=>array(
> >  'Article.is_read'=>0,
> >  'Article.status'=>1,
> >  'Tag.name'=>'cakephp'
> > )));
>
> > HTH, Paul.
>
> > P.S. Notice how I have changed some of your field names and values.
> > Your isRead field should be lowercased and underscored and if boolen
> > use tinyint(1) with 0 and 1.  When searching for articles by tag you
> > would normally recieve the tagname in the request (much better for
> > seo) so to query by Tag.id would require an extra find that I would
> > say is unneccessary when you can filter by Tag.name (especially if you
> > have the name field unique indexed).  I would also switch
> > Article.status for numerical values, ideally with a lookup table so
> > you can easily add/edit status text across all articles.
>
> > On Oct 30, 8:50 am, SERKAN TURAN  wrote:
> > > Hi,
> > > I have an query and I could not figure it out what is the cakephp form of
> > > it.
>
> > > query:
> > > ---
> > > SELECT *
> > > FROM
> > >   tags`
> > >   INNER JOIN `tags_articles` ON (`tags`.`id` = `tags_articles`.`tag_id`)
> > >   INNER JOIN `articles` ON (`tags_articles`.`article_id` =
> > `articles`.`id`)
> > > WHERE
> > >   `articles`.`isRead` = 'Not' AND
> > >   `tags`.`id` = 3 AND
> > >   `articles`.`status` = 'New'
> > > ORDER BY
> > >   `articles`.`name` DESC
>
> > ---
> > ---
>
> > > Thnks..
> > > ST
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

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


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


Re: Why specify the controller in the view?

2011-11-01 Thread Jeremy Burns | Class Outfit
I think it has more to do with belt and braces than laziness. I always add the 
controller because I want to be sure it goes where I want it to go, rather than 
letting Cake (potentially) decide for me.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 09:21, WebbedIT wrote:

> It's not lazyness per se, both are completely valid and it's up to you
> to decide which to use in what circumstances.  If you are 100% certain
> that the view containing the link will only ever be called from a
> certain controller, then you do not need to include that controller in
> the url array as the controller being used at the time will be
> inserted.
> 
> There are many different ways to specify arguments/params for most
> functions ... just learn all of those ways and use the right one for
> you in the right circumstances.
> 
> HTH, Paul
> 
> On Oct 31, 8:12 pm, "Yves S. Garret" 
> wrote:
>> I got a pet peeve about being 'lazy' :-) .  Too often it leaves vague code
>> that some poor soul needs to update years after the fact, with little
>> understanding of what's going on.
>> 
>> I'll specify the exact controller.
>> 
>> On Mon, Oct 31, 2011 at 3:41 PM, euromark wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> both will work exactly the same WITHIN the controller
>>> you may leave it out in this case.
>>> its always good practice to specify the controller, as well, though.
>> 
>>> but if you are outside of this controller you MUST specify it
>>> so better include it everywhere. especially if you move code around
>>> (copy and paste)
>>> or if you make it an element (which could be included in any other
>>> view/controller/layout.
>> 
>>> so better safe than sry :)
>>> we programmers are just lazy sometimes
>> 
>>> On 31 Okt., 20:28, "Yves S. Garret" 
>>> wrote:
 I just noticed this in the cakephp book.  In the first example, you have
 the following line(s) in index.ctp:
>> 
 http://book.cakephp.org/view/1536/Creating-Post-Views
>> 
 Html->link($post['Post']['title'], array('controller'
>>> =>
 'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the
 first example of a view
>> 
 http://book.cakephp.org/view/1540/Editing-Posts
>> 
 Html->link($post['Post']['title'], array('action' =>
 'view', $post['Post']['id']));?>  <--- this is a later example, when
>>> you're
 editing the post.
>> 
 The question is about this line: 'controller' => 'posts' <--- this
>>> doesn't
 seem to affect the way info is posted.  index.ctp is already tied to the
 index method in the PostsController, so what role does this play?
>> 
>>> --
>>> Our newest site for the community: CakePHP Video Tutorials
>>> http://tv.cakephp.org
>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
>>> others with their CakePHP related questions.
>> 
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group
>>> athttp://groups.google.com/group/cake-php
> 
> -- 
> Our newest site for the community: CakePHP Video Tutorials 
> http://tv.cakephp.org 
> Check out the new CakePHP Questions site http://ask.cakephp.org and help 
> others with their CakePHP related questions.
> 
> 
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php

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


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


I hate CLI

2011-11-01 Thread Jeremy Burns
I'm a GUI man me. CLI stuff just makes me go blank. It's like staring
into a black hole. Give me something I can point at and click and I'm
a happy man.

I'm following the tutorial for setting up David Persson's media
plugin. Each time I run this:

chmod -R a+rwX webroot/media/{transfer,filter}

... in Terminal I get this error:

chmod: Invalid file mode: -R

I have Googled but can't find the answer. Can any of you CLI junkies
help me out please?

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


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


Re: Why specify the controller in the view?

2011-11-01 Thread WebbedIT
It's not lazyness per se, both are completely valid and it's up to you
to decide which to use in what circumstances.  If you are 100% certain
that the view containing the link will only ever be called from a
certain controller, then you do not need to include that controller in
the url array as the controller being used at the time will be
inserted.

There are many different ways to specify arguments/params for most
functions ... just learn all of those ways and use the right one for
you in the right circumstances.

HTH, Paul

On Oct 31, 8:12 pm, "Yves S. Garret" 
wrote:
> I got a pet peeve about being 'lazy' :-) .  Too often it leaves vague code
> that some poor soul needs to update years after the fact, with little
> understanding of what's going on.
>
> I'll specify the exact controller.
>
> On Mon, Oct 31, 2011 at 3:41 PM, euromark wrote:
>
>
>
>
>
>
>
> > both will work exactly the same WITHIN the controller
> > you may leave it out in this case.
> > its always good practice to specify the controller, as well, though.
>
> > but if you are outside of this controller you MUST specify it
> > so better include it everywhere. especially if you move code around
> > (copy and paste)
> > or if you make it an element (which could be included in any other
> > view/controller/layout.
>
> > so better safe than sry :)
> > we programmers are just lazy sometimes
>
> > On 31 Okt., 20:28, "Yves S. Garret" 
> > wrote:
> > > I just noticed this in the cakephp book.  In the first example, you have
> > > the following line(s) in index.ctp:
>
> > >http://book.cakephp.org/view/1536/Creating-Post-Views
>
> > > Html->link($post['Post']['title'], array('controller'
> > =>
> > > 'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the
> > > first example of a view
>
> > >http://book.cakephp.org/view/1540/Editing-Posts
>
> > > Html->link($post['Post']['title'], array('action' =>
> > > 'view', $post['Post']['id']));?>  <--- this is a later example, when
> > you're
> > > editing the post.
>
> > > The question is about this line: 'controller' => 'posts' <--- this
> > doesn't
> > > seem to affect the way info is posted.  index.ctp is already tied to the
> > > index method in the PostsController, so what role does this play?
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

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


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


Re: Implementing a search functionality

2011-11-01 Thread WebbedIT
Me thinks Jeremy has been reading too many of Andy's replies :P

On Nov 1, 5:31 am, Jeremy Burns | Class Outfit
 wrote:
> I hope we all know that I was being ironic. ^^
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 1 Nov 2011, at 03:48, Yves wrote:
>
>
>
>
>
>
>
> > There actually is a search engine plugin called joogle.
>
> > On Oct 31, 2011, at 11:20 PM, Ryan Schmidt  
> > wrote:
>
> >> On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote:
>
> >>> I didn't search there. I used another little know search engine called 
> >>> Joogle (or something like that):
>
> >> You probably meant "Google".
>
> >> --
> >> Our newest site for the community: CakePHP Video 
> >> Tutorialshttp://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

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


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


Re: spit out the sql code just for one line?

2011-11-01 Thread AD7six


On Nov 1, 4:19 am, Ryan Schmidt  wrote:
> On Oct 31, 2011, at 03:16, AD7six wrote:
>
> > On Oct 31, 6:04 am, iphone5  wrote:
> >> $this -> Question-> deleteAll( array( 'survey_question_id' =>
> >> $question[ 'SurveyQuestion'][ 'id' ] ) );
> >> Is there any way to show the sql code for this line?
> >> I know if I turn on the debug = 2 it will show all the sql code for
> >> the whole page but I just want to do it for a single line of code.
>
> > You put half the answer in the question.
>
> Since you seem to know it, what is the entire answer? Are you suggesting he 
> should set debug=2 and just ignore all the other lines in the output that 
> he's not interested in, or is there a more direct answer to his question 
> hidden in your reply?

You're right Ryan, and infact just manipulating debug won't work.

however: iphone5, why do you want the sql for one function?

AD

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


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