Re: counterCache doens't update

2008-09-21 Thread sumanpaul
I am facing same kind of issue here. I was working with counterCache - Cache your count(). In principle it work like a cake :) But I have the following situation ... Taking the same example given in the manual , what happens when I am not deleting the image but only changing the Album. Let's say

Re: Generate List with SQL calculated Fields

2008-09-21 Thread David C. Zentgraf
Play around with the Set::combine() or Set::extract() methods to get the array into the right shape. http://api.cakephp.org/class_set.html#80506e373d04c93eb4dc1582d8e5c09c On 22 Sep 2008, at 06:26, ORCC wrote: > > Usually I create lists for using with $form->select(), vía > find('list') method

nicer flash+redirect page?

2008-09-21 Thread park
Hi, Is there any better practice of implementing a nicer-looking flash redirect? Many thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegrou

Re: correct syntax for an OR

2008-09-21 Thread teknoid
for something simple like this, you could use an IN ... find('all', array('conditions'=>array('SomeModel.field'=>array($email1, $email2)... On Sep 21, 8:32 pm, . <[EMAIL PROTECTED]> wrote: > Hi > > How would I do an OR in the conditions, such as the following? What's the > correct syntax? Thanks

Re: CakePHP not recommenable for busy websites?

2008-09-21 Thread Aaron Shafovaloff
Yeah, get to know the containable behavior. On Sep 21, 12:35 am, toby78 <[EMAIL PROTECTED]> wrote: > I am currently evaluating different frameworks and also looking at > cakePHP. > > My first thought was that it seems not very efficient... > > If you have an object, e.g. "User" that has other rel

Re: correct syntax for an OR

2008-09-21 Thread David C. Zentgraf
http://book.cakephp.org/view/74/Complex-Find-Conditions On 22 Sep 2008, at 09:32, . wrote: > Hi > > How would I do an OR in the conditions, such as the following? > What's the > correct syntax? Thanks > > $messages = $this->Message->find('all', > array('conditions'=>array('Email.email'=>$ema

correct syntax for an OR

2008-09-21 Thread .
Hi How would I do an OR in the conditions, such as the following? What's the correct syntax? Thanks $messages = $this->Message->find('all', array('conditions'=>array('Email.email'=>$email1 OR 'Email.email'=>$email2))); --~--~-~--~~~---~--~~ You received this me

Re: CakePHP not recommenable for busy websites?

2008-09-21 Thread Nate
http://book.cakephp.org/view/510/Sites-in-the-wild Take special note of the Mozilla Add-ons portal, one of the most heavily trafficked in the world. On Sep 21, 2:35 am, toby78 <[EMAIL PROTECTED]> wrote: > I am currently evaluating different frameworks and also looking at > cakePHP. > > My first

Re: Accessing JSON data in controller

2008-09-21 Thread Donkeybob
What is your controller code? are you using json_encode in it? something like this ---> echo json_encode($this->Model- >find('all')); On Sep 21, 7:24 pm, jkritikos <[EMAIL PROTECTED]> wrote: > Hi there, > > I'm having trouble accessing JSON data from a controller. (I'm using > cake version 1.2

Re: How to count associated records in a model?

2008-09-21 Thread David C. Zentgraf
You can skip the App::import step completely. Your models are already associated, so $this->Product is already accessible. In fact, App::import doesn't do anything, it works like require_once(), you would still have to manually instantiate the imported model class yourself (i.e. App::impor

Accessing JSON data in controller

2008-09-21 Thread jkritikos
Hi there, I'm having trouble accessing JSON data from a controller. (I'm using cake version 1.2). My JSON request is as follows: $.getJSON( '/locations/find', {s1:val1, s2:val2}, function callback(data){ //doStuff }); I know that the JSON request is made just fine because when I tried it wit

Re: simple session question - for Authentication

2008-09-21 Thread Brett Wilton
in your controller you can use $this->Auth->user('id') or $this->session->read('Auth.User.id') or in your view $session->read('Auth.User.id') --- Brett Wilton http://wiltonsoftware.com On Sat, Sep 20, 2008 at 3:51 AM, gabriel <[EMAIL PROTECTED]> wrote: > > Hi, sorry..found the solution to

Re: Problem with reading cookie

2008-09-21 Thread villas
Yes, you are right about that introduction; that section seems to be out of date when compared to the API: http://api.cakephp.org/cookie_8php-source.html I have now submitted an update for that section of the Book so that others will not be so confused. Hopefully it will appear soon once it has

Model Design

2008-09-21 Thread aborjinos
Hi everybody, I have 4 tables and I want to create a custom query this is my correct sql line SELECT COUNT(*) AS "count" FROM "groups_permissions" AS "GroupPermission" LEFT JOIN "groups" AS "Group" ON ("GroupPermission"."group_id" = "Group"."id") LEFT JOIN "permissions" AS "Permi

Generate List with SQL calculated Fields

2008-09-21 Thread ORCC
Usually I create lists for using with $form->select(), vía find('list') method. For instance, in the controller method $l = $this->ProductCategory->find('list'); Another way to create the list is by using a plain query: $l = $this->ProductCategory->query('SELECT `id`, `name` FROM product_catego

Re: How to count associated records in a model?

2008-09-21 Thread majna
http://book.cakephp.org/view/75/Saving-Your-Data#counterCache-Cache-your-count-490 book.cakephp.org search feature is useless. There is whole chapter about "counterCache" but no search results ?! On Sep 21, 6:41 pm, ORCC <[EMAIL PROTECTED]> wrote: > I have a Manufacturer model having many Produc

Re: using Configure::read in a model definition file

2008-09-21 Thread ORCC
It is a php syntax issue. When you declare a class attribute, its value must be constant, i.e class Foo { var $foo = Array('equalTo' => 'xx', 'name' => yy); //correct, since all array's elements are constant var $bar = Array('equalTo' => Conf::read('Secret')); //Error, since the value

CakeAMF and Flex DataGrid

2008-09-21 Thread [EMAIL PROTECTED]
Hi, exists a better way for populating DataGrid in Flex application from CakePHP (with CakeAMF) as this example: [Bindable] public var dgItems:ArrayCollection = new ArrayCollection(); for (var i:int=0; i < result.Users.length; i++) { dgItems.addItem(result.Users[i].User); } this solutio

Re: Completely Dynamic Reporting

2008-09-21 Thread [EMAIL PROTECTED]
The main one that got down to some of the useful details was this one. http://ciobriefings.com/Publications/WhitePapers/DesigningtheStarSchemaDatabase/tabid/101/Default.aspx highly recommended reading. When I finally get my stuff together and have a nice re-usable package i'll probably post a wri

cakephp email component

2008-09-21 Thread base64
Dear all, I'm using CakePHP Email component, when i sent email and i set smtp_errors; $this->set('smtp-errors', $this->Email->smtpError); the variable *smtp-errors* return : *220-We do not authorize the use of this system to transport unsolicited, *and my email did'not sent.* *how to solved th

asking about Vertical database on CakePHP

2008-09-21 Thread Yodi Aditya
I have reading about vertical database (column-store) on google last night. it seem interesting method. Is anybody using vertical database with CakePHP? Is vertical database good for designing some application using cakePHP? if someone has vertical database using cakePHP, please let me know.. Th

How to count associated records in a model?

2008-09-21 Thread ORCC
I have a Manufacturer model having many Products. In order to return the number of Products of a Manufacturer I wrote the following method in Manufacturer: function countProducts() { App::import('Model','Product'); $condition = Array('manufacturer_id' => $this->id) return $this->Product

using Configure::read in a model definition file

2008-09-21 Thread Zoltan
Quick question, In my model file, I'm using somethings like: 'rule' => array( 'equalTo', "secret phrase" ), 'required' => true // hard-code value into file Instead of: 'rule' => array( 'equalTo', Configure::read('forms.secretPhrase') ), 'required' => true For some reason this results in a syn

Re: Using the Cake CLI

2008-09-21 Thread David Persson
On 21 Sep., 13:18, Eur <[EMAIL PROTECTED]> wrote: > Hi guys! > > I'm new to cakePHP, but from what I've seen, I'm loving it. I like the > ease of use that the conventions offer me, and just went through the > blog tutorial. I now want to advance to the "Simple ACL" tutorial, but > I can't ge

Re: Returning false from beforeValidate wont abort save

2008-09-21 Thread Novice Programmer
got that... Need to set soem field as invalid using Model::invalidate so that the save aborts.. By I have another query now.. How do i fetch records saved to DB after saveAll. Thanks. On Sun, Sep 21, 2008 at 8:23 PM, Novice Programmer <[EMAIL PROTECTED] > wrote: > Hello guys, > > in some cases

Re: redirect from non www to www

2008-09-21 Thread yaqoob
thanks, it also worked for, but probably it's worth noting, that these declarations should be before usual CakePHP rewrites, so it should be like this (at least I think so, the other way around didnt work for me) RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$ [NC] Rew

Re: CakePHP not recommenable for busy websites?

2008-09-21 Thread Novice Programmer
Then there are bind/unbind model plus the new containable behavior to let u select the columns in the query.. thanks. On Sun, Sep 21, 2008 at 8:03 PM, Zac Tolley <[EMAIL PROTECTED]> wrote: > > Not only can u cache but In the find function use can set how deep the > result goes and I find this ac

Returning false from beforeValidate wont abort save

2008-09-21 Thread Novice Programmer
Hello guys, in some cases i want to abort saving in beforeValidate callback. I have returned false in that case, but i am not able to abort saving, it still continues to save the record. Any ideas on what it can be? -- Thanks & Regards, Novice. --~--~-~--~~~---~--~--

Using the Cake CLI

2008-09-21 Thread Euroooo
Hi guys! I'm new to cakePHP, but from what I've seen, I'm loving it. I like the ease of use that the conventions offer me, and just went through the blog tutorial. I now want to advance to the "Simple ACL" tutorial, but I can't get the CLI to work properly. PHP on the command line is no problem

Re: Model with varying fields? can Cake help in some way?

2008-09-21 Thread [EMAIL PROTECTED]
Thanks for replying to my slightly disorganised post. :) I'll take a look at your article and see if it will show me the right way forward for my situation. >From a quick peak at the sql it looks promising. /Martin On Sep 21, 1:24 am, Joe <[EMAIL PROTECTED]> wrote: > I brought this up to anoth

Re: CakePHP not recommenable for busy websites?

2008-09-21 Thread Zac Tolley
Not only can u cache but In the find function use can set how deep the result goes and I find this actually results in ability to have fine tuned lean db access Sent from my iPhone On 21 Sep 2008, at 07:35, toby78 <[EMAIL PROTECTED]> wrote: > > I am currently evaluating different frameworks

Re: Accessing multiple databases within a single Mysql instance in a single query.

2008-09-21 Thread Rick
I tried that technique but it did not work. It appears that you can't have multiple "useDBConfig"s in a single query. This seems reasonable since you also can't do a raw select using multiple connections which is what the useDBConfigs give you (I think). Richard On Sep 20, 5:56 pm, Adam Royl

Ajax example: adding/removing items ("tags")

2008-09-21 Thread toby78
I have looked for a CakePHP example that allows to add items using a text input field that will be added in a list without reloading the page. E.g: + item 1 [remove] - text input field - when you add "item 2" + item 1 [remove] + item 2 [remove] ___

Re: $this->

2008-09-21 Thread Jon Bennett
hi Matt, > What does $this-> do? Is there a specific meaning to $this and to the > "->" symbol? http://www.devarticles.com/c/a/PHP/Object-Oriented-Programming-in-PHP/ jb -- jon bennett w: http://www.jben.net/ iChat (AIM): jbendotnet Skype: jon-bennett --~--~-~--~~

The dreaded mod_rewrite and htaccess. Again

2008-09-21 Thread steward
Under WAMP XP, "Production install" c:\domains\cake_1_2 app webroot cake docs vendors Defined alias "c:\domains\cake_1_2\app\webroot" to be http://localhost/cakeblog URL http://localhost/cakeblog is good.. Happy front page, happy database etc. PROBLEM URL http://localhost/cakeblog/

Putting new Helper into Core for Sharing

2008-09-21 Thread jabocs
I'm new to cake and still learning the boundaries. However, I am writing a CMS type system that will have the same components across several CakePHP websites at different domains on our server. I have the core cake lib on the server so all sites share the same core. And I'm using RC2. The end

Embedding a CakePHP Application into Wordpress

2008-09-21 Thread Lethalpig
I've been searching for a long time now...but I'm not seeing anything that's really explicit on how I can handle this. I've built a functioning CakePHP application. We've recently made the decision to use Wordpress as our CMS. So, we have a functioning CakePHP app (which is a pretty self contai

CakePHP not recommenable for busy websites?

2008-09-21 Thread toby78
I am currently evaluating different frameworks and also looking at cakePHP. My first thought was that it seems not very efficient... If you have an object, e.g. "User" that has other related objects such as "Message" or "Photo" - there will be SQL statements to select all content from all relate

$this->

2008-09-21 Thread shinsyotta
Guys, I'm new to CakePHP and although I've dabbled in PHP, it was a few years ago. So, I have a very basic question: What does $this-> do? Is there a specific meaning to $this and to the "->" symbol? Actually, on a related note- anyone know how to find something like "$this" on a web search?

Embedding a CakePHP Application into Wordpress

2008-09-21 Thread Lethalpig
Hrmmm...I'm a first time poster here...thought this was already posted, but I don't see it now. Hope I'm not duplicating :-) Anyway, I'll make it shorter this time. I want to embed a CakePHP app into a Wordpress CMS (small site). I want to share wordpress's session vars, css, js, etc. in the C

Aggregator Behavior problems but can't post this to cakephp as comment

2008-09-21 Thread Paul Josephson
I am posting this here because for some reason the Cakephp site won't let me submit a comment (even though I am logged in; it says there is a problem but shows no more info.) So without further ado here is the situation maybe someone can assist me with. I am currently playing around with the Agg