Given the following Model relations:
article -- HABTM (articles_tags) -- tag
How do I fetch back a list of Tags with the count of associated
Articles?
I've tried (in the Tag Model):
$data = $this-find(all, array(
fields=array(
Put it in the finderQuery of your association in the model.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this
For our photoblog, at http://cheesecake-photoblog.org/demo/tags/, we use
something like following query
SELECT tags.*, COUNT(photos_tags.tag_id) AS totalPhotos FROM tags LEFT JOIN
photos_tags ON tags.id = photos_tags.tag_id GROUP BY tags.id ORDER BY
tags.tag ASC
to generate tag cloud
Hope this
Hi. I have an order form and would like to show a summary in a
Modalbox box with the options to cancel or confirm the order.
Connecting the Modalbox to the onClick function of the form submit
button (as below) does not seem to work, as it sends the user off to a
new page instead of showing the
There is no 'label' parameter with a submit button, this needs to be
changed to 'value'.
Your 'onclick' parameter also needs a lot of extra information, the
main part being 'return: false;' to stop the form from submitting in
it's usual manner. Because you are submitting a form through ModalBox
Hi there,
i have put a form in my index.ctp to perform a custom query in the
index() action of my controller.
It worked fine until I used 'Security'. So, I added beforeFilter() in
my controller and defined
$this-Security-requireAuth('add', 'edit', 'delete');
BUT, it still leads to a 404, when
Jakob: I am very interested in doing the same thing. Please let me
know if you get it working. Mint.com has a really great interface for
submitting and confirming forms. Does anyone know of a good tutorial
that covers something like this?
On Jan 17, 7:53 am, WebbedIT p...@webbedit.co.uk wrote:
Hello all..
I am working on application in which i have to add functionality like
attendance.
there are two buttons 1. Mark In and 2. Mark Out
Database has 'attendances' table. When user Marked In table get new
entry. and when he mark out that entry is updated.
So once user click Mark In
Are there any known advantages or disadvantages of
1) doing all associations ONLY when needed and only the ones that are needed
or
2) putting lots of associations in the models and trying to unbind / contain
them out of the urls ?
Just trying to find a consistent way to get the most out of the
Ok, thanks for some direction stefano. I'll look into that. Cheers :)
On Fri, Jan 16, 2009 at 10:18 PM, stefano ssalvat...@gmail.com wrote:
maybe is the rewrite mod :P or the .htaccess
On Fri, Jan 16, 2009 at 10:34 PM, PHPScriptKiddy curl.rob...@gmail.com
wrote:
Hi guys,
I am new to
I expect you are approaching a problem from the wrong angle and there
may be a better solution which could be offered if you tell us what it
is you are trying to achieve. Can you explain why you would want to
do this? What would you do with the result set after altering the top
level key
Here is the bottom part of my database.php file. I don't think it has
a syntax error.
class DATABASE_CONFIG {
var $default = array(
'driver' = 'postgres',
'host' = 'localhost',
'login' = 'postgres',
'password' = 'postgres',
Are you using ajax calls or submitting and reloading the page each
time a button is pressed?
If using ajax calls then you need some javascript to disable/enable
the relevant buttons, give them unique ids and call something like
onclick=this.disabled=false; otherButtonId.disabled=true when a
I'm wondering if many people use CakePHP for commercial use. I'm
planning to start a business and I'd like to use CakePHP and
PostgreSQL to support this business. However, it seems like it takes
quite a while to get support when it's needed, even for basic needs.
And, yes, I do check the
If Event belongsTo User then you need a user_id field in the Event
table
If you have a two part form which first creates an Event then creates
a User after submitting the Event part of the form you could then pass
$data['Event']['id'] to the User form (will be available after saving
the Event
I am looking to move to CakePHP as my commercial solution and I have
shared the same concerns over my lengthy learning curve.
I've submitted a lot of questions to this group and sometimes I have
had to resubmit the same questions in various different ways to get an
answer, but I accept that
You have an extra comma here: 'prefix' = '',
I can't think of why this is happening, though. Weird
On Sat, Jan 17, 2009 at 11:50 AM, reidster reidmckin...@gmail.com wrote:
Here is the bottom part of my database.php file. I don't think it has
a syntax error.
class DATABASE_CONFIG {
Hello,
I wonder if it is possible to login a user automatically with Auth?
Typically You allow anonymous access to some actions and require login
for others. What if You want on session start to login user lets call
him anonymous and later if user log in - change them with real
credentials (I use
Thanks WebbedIT!
Your answer was almost perfect. For some reason, method: 'post' has to
come before Form.serialize( 'FormID' ) in the list. Now I have /orders/
add showing in Modalbox. The code:
?php echo $form-create ( 'Order' ); ?
Form items...
?php
echo $form-end ( array(
On 17 Jan, 20:45, Jakob Malm jakob.m...@gmail.com wrote:
Thanks WebbedIT!
Your answer was almost perfect. For some reason, method: 'post' has to
come before Form.serialize( 'FormID' ) in the list. Now I have /orders/
By the way, I found out about the ordering on
Although I'd certainly like to get to the rapid part of cakePHP
development, I'm not as concerned about the development time as I am
concerned about production downtime. I do not have infrastructure to
test code under load and for every possible query combination and
software version combination
On Jan 16, 6:20 pm, Leandro Lucarella llu...@gmail.com wrote:
PS: I'm using 1.2.0.7962 final.
If it's of any help, I've upgraded to 1.2.1.8004 and the problem
remains...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Ok here is the dilema. I need to create 2 user forms basically the
same, but they have different validations. The forms are identical
only differance is the validation on the contractor checks the email
field for free email accounts which are not allowed so i split the
forms up into separate
I'm not sure I understand fully, but it sounds like you want the controller
to run automatically, without a request from a Web client? In that case,
you should create a command-line script and call it with crond. Of course,
you'll need command-line access to the server.
Here's a discussion
Our standard practice for efficiency, consistency, and of course minimal extra
code, is
- to define all model associations in our model: You would soon get
sick of binding them all on the fly, you could of course come up with a custom
behavior or similar to do it in short hand via
Store the data in a cookie, in this case Anonymous should be be a user
in the system as well.
Just use/look at the $this-Auth-login() method. Could probably do
something with that.
Also how would an anonymous login to another user account, if the
system always logs him in as anonymous?
Your concerns are legitimate for any open source software. Perhaps you can
find a consultancy that can offer you support for more rigorous challenges.
That way, you get the best of both worlds: free, friendly-licensed,
extensible, community-supported software; and dependable experts who will
There is in fact such a group. I would say they are the last resort,
white night, zombie hunting, bug assassins but they can and will do
the job with perfection in mind. That of course is the CakeDC (
http://cakedc.com/ ).
Team members:
* Larry E. Master
* Garrett J. Woodworth
*
To me, at least, your asking a few questions here.
I have personally used cake for commercial purposes for a couple of years
now, and the company I currently develop for (with a number of large high
traffic apps) are busy getting things switched over to cake. Cake offers
such an awesome
Personally I find it easier to define all associations and use
Containable or recursive = -1 to define what data I get back. It's
easier to understand for me and works fairly well, makes it quick to
develop and easy to debug.
The only potential downside is that every associated model is loaded,
The user does not already exist. The event is being created, then
immediately after the user is being created.
I forgot to mention, it occured to me to save the user first, then the
event, but its just for this specific application we decided to do it
this way.
So how do I set the value of the
Also how would an anonymous login to another user account, if the
system always logs him in as anonymous?
After getting data from the login page I will change user data saved
in session... I did thing like this in .net, I am not sure It is
possible with cake Auth, but it is quite versatile :)
Thank you Paul, Andrew, and asciimo for your responses. Your opinions
were very thoughtful and thorough and provided me with some good
perspectives to think about as I weigh my options.
Thanks again,
Reid
On Jan 17, 4:20 pm, websta* subscripti...@webprogression.co.nz
wrote:
To me, at least,
I think this is worth of become an bakery post...
Regards,
- Dardo.
On Mon, Jan 12, 2009 at 2:19 PM, Martin Westin
martin.westin...@gmail.com wrote:
Hi all,
It is not overtly documented but you can check your http
authentication against your normal users table, just like Auth
Component
After a bit of a hiatus, I'm back ... and very saddened to see this
still isn't fixed ...
seriously? Has no one else run into this??
On Nov 28 2008, 1:25 pm, Brenton B brenton.bar...@gmail.com wrote:
Yup, and was met with a need test case reply ... which I understand
is required ...
All my rows are returned in a HABTM. Are you using the new version?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from
In my book, something needs to be broken before it should be
fixed. ;-)
In a default HABTM relationship, multiple records with the same
foreign key pair are not allowed. Simple as that. If you want to do
something custom, set 'unique' to false, and/or create a join model
and set up your
Anyone had any luck with these?
There are still a ridiculous amount of large queries going on.
On Nov 28 2008, 1:22 pm, Brenton B brenton.bar...@gmail.com wrote:
Overall, looks like 'depth' and 'recursive' are conflicting and
causing the extra queries.
Anyone had the time to take look?
When
You can't have an Event.user_id if there's no User. You're doing this backwards.
On Sat, Jan 17, 2009 at 5:43 PM, mike mwu...@gmail.com wrote:
The user does not already exist. The event is being created, then
immediately after the user is being created.
I forgot to mention, it occured to
before I abandon this effort in favor of commercial software...
What commercial software?
As far as I know, in the php world at least, there are no commerical
frameworks which come close to cake's features and tested reliability.
--~--~-~--~~~---~--~~
You
40 matches
Mail list logo