Re: Table associations the CakePHP way

2006-12-26 Thread Adrian Godong
have category.name and layout.name instead of the id of the category. I could build a MySQL query for this, but I wonder what's the CakePHP way. (The more ways, the marrier it is ;)) -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador

RE: findBy issue

2006-12-24 Thread Adrian Godong
I'm assuming that you don't want any 'User' added on the query? -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kynlem Sent: 25 Desember 2006 5:24 To: Cake PHP Subject: findBy issue Hello, I've been having some problems with a findByfield

RE: findBy issue

2006-12-24 Thread Adrian Godong
@googlegroups.com Subject: Re: findBy issue 2006/12/25, Adrian Godong [EMAIL PROTECTED]: I'm assuming that you don't want any 'User' added on the query? What do you mean? The problem is that there is no value on the right side of the comparison operator in the where clause

RE: Joining 2 tables - better practice?

2006-12-23 Thread Adrian Godong
Not that I know of, and can't think of anything easy to implement. Unless you created a non-normal view where each Product row will have their own Holiday fields (therefore, duplicating Holiday fields for every Product row). CMIIW, are you creating an array of Product for a specific Holiday

Re: Newbie question

2006-12-22 Thread Adrian Godong
= '. $this-Session-read('User.id'), ) ); If this works, I could just read the $shop['User'] to check if the current user can edit the Shop details. But it doesnt seem to work. Any better way to get this working? TIA john -- Adrian

RE: does cake not join tables when using hasMany?

2006-12-20 Thread Adrian Godong
I think it has something to do with the result parser. It's not a bug, it's by design. Other association that does join tables are belongsTo. Why do you need it in one query? -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]

RE: Joining 2 tables - better practice?

2006-12-20 Thread Adrian Godong
OK, so basically you have an array on top of everything. That's why you can't debug($data['Product']); or loop it directly. For this particular $data, to iterate through each product, you will need to use: Foreach ($data as $holiday) { Foreach ($holiday['Prodcut'] as $product) { [Write

RE: Joining 2 tables - better practice?

2006-12-19 Thread Adrian Godong
? I'm still interested in this problem. It seems something syntactically wrong or I'm just dead reading code. Could you supply us again with the output of debug($data); and how do you plan on using it (i.e. the foreach block)? The error should be there somewhere. -Original Message-

RE: Legal Concerns Regarding CakePHP and Cake Software Foundation

2006-12-18 Thread Adrian Godong
Prof. Lessig has one of those great presentations about copyright vs. Innovation. Try googling it up. I need to dig in several gigs of data to find the link. :D (usually, keyword Lessig does the job, it's in flash, BTW) -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL

RE: Joining 2 tables - better practice?

2006-12-18 Thread Adrian Godong
What're you trying to do? Your array dump looks like only contains ONE Holiday with MANY Products (which is TRUE, according to your definition earlier). If you wanted to iterate through the products, you should use: Foreach($data['Product'] as $product) Not $data['Holiday']. -Original

Re: Legal Concerns Regarding CakePHP and Cake Software Foundation

2006-12-18 Thread Adrian Godong
PROTECTED] wrote: On 12/19/06, Adrian Godong [EMAIL PROTECTED] wrote: Prof. Lessig has one of those great presentations about copyright vs. Innovation. Try googling it up. I need to dig in several gigs of data to find the link. :D I think this is what you mean: http://philosophytalk.org

RE: Joining 2 tables - better practice?

2006-12-17 Thread Adrian Godong
Assumed that you do a findAll from the controller to variable named holiday. You can access it from $holiday['Holiday']['Product'] array. If you're not sure, you can try inserting debug($holiday); to see the structure of your variable. -Original Message- From:

RE: Edit form for associated tables

2006-12-14 Thread Adrian Godong
The selectTag has a third (or fourth) parameter after the name/value arrays parameter that accepts selected single name or array of names. Matching name from name/value parameter and selected name parameter will have the selected attribute on the generated HTML tag. Let me know if you need more

RE: can I use generateList( ) get rather than Id?

2006-12-08 Thread Adrian Godong
To simplify your code, you can define var $displayField = 'name' in your Model, and have everything generated by the generateList(); -- no params necessary. You will need to utilize Javascript on your second question. On the first selectTag, add 'onChange' = 'javascript:changeSelect();' on the

RE: findall custom query

2006-12-08 Thread Adrian Godong
Well, the first param for the findAll is the SQL condition. CakePHP is not smart enough (yet) to understand arrays of conditions, it just accepts a string and place it after the WHERE clause in the SQL statement. To answer your question, change the array into it's SQL language (i.e. global=1 AND

Re: Cant load prototype in my default.html .

2006-12-07 Thread Adrian Godong
No, you should put var $helpers (notice the 's') on your code. And keep the 'Javascript'. On 12/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: try 'javascript' instead of 'Javascript' -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador

RE: how manage more than one operation in the same view

2006-12-07 Thread Adrian Godong
1. You have several different options. You can use requestAction to call other controller/action and display the results in the current view/controller. If you only need the view (not the logic from the controller/action), you can move the view code to an element, and call the renderElement

RE: Cant load prototype in my default.html .

2006-12-07 Thread Adrian Godong
You're welcome. Happened to me quite often in the past. :D -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ERic ZoU Sent: 07 Desember 2006 19:29 To: Cake PHP Subject: Re: Cant load prototype in my default.html . Thanks Adrian. s Big S

Re: why getLastInsertID doesn't work?

2006-12-05 Thread Adrian Godong
['pcsDuration'].',NOW()); mysql_query('SET NAMES gbk;'); $this-execute($sql); $pid=$this-getLastInsertID(); ... problems is that $pid is empty .why?? thanks !!! -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You

Re: Replacing Html Helper

2006-11-29 Thread Adrian Godong
? -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from

RE: Multiple HATBM (n:n) using the same model for different purposes

2006-11-28 Thread Adrian Godong
misunderstood you ? +++ clemos On 11/28/06, Adrian Godong [EMAIL PROTECTED] wrote: Is the second solution feasible? I mean AFAIK, if you stick to the default CakePHP implementation of HABTM, you can't have any other field other than the two PK/FK fields. Take a look at how CakePHP handles

Re: beforeFilter Problem

2006-11-27 Thread Adrian Godong
Yes, components DO get loaded before CakePHP access beforeFilter. You might haven't add the component to the controller $components variable. On 11/28/06, Synchro [EMAIL PROTECTED] wrote: Adrian Godong wrote: Hi, I'm trying to implement some user authentication system, and need to check

RE: Querying Question

2006-11-19 Thread Adrian Godong
From database normality PoV, you should stick with your current structure (approach 2). Complexity of SELECT query should belong to CakePHP engine, not yours. If you have defined the Model Association correctly, CakePHP will also retrieve related tables, so you shouldn't worry about how to

RE: Element vs Helper

2006-11-16 Thread Adrian Godong
/16/06, Adrian Godong [EMAIL PROTECTED] wrote: What's the difference between element and helper? When should I use one over another? Let me try and put it as simply as possibly Element = snippet from a template which you just render in your templates an example would be a dynamic menu which can

RE: RE: Element vs Helper

2006-11-16 Thread Adrian Godong
a component is like a helper for your controllers like many controllers might want to send email, so you could have a email component Sam D On 11/16/06, Adrian Godong [EMAIL PROTECTED] wrote: OK, I got the big point. But pls CMIIW: anything that a Helper can do, an Element can also do the exact

Element vs Helper

2006-11-15 Thread Adrian Godong
Guys, What's the difference between element and helper? When should I use one over another? Thanks! -- Adrian Godong [EMAIL PROTECTED] Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: ERROR_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
Can you post the code? Mine's working well based on the tutorial.On 11/12/06, Eric [EMAIL PROTECTED] wrote: Thanks Buddy...BUT, I just can create a rss by browser like http://localhost/cake/posts/rssAnd I can add it for my FF2.0BUT it is contains nothing...Why?-- Adrian Godong[EMAIL PROTECTED

Re: ERROR_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
-outputFeed();to $rss-saveFeed();I have save the feed by my FF, and it appeard in my bookmarks Toolbar folder. BUT, It contains nothingDon't know why...-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message

Re: ERROR_Adding an RSS feed using FeedCreator

2006-11-12 Thread Adrian Godong
($hour,$min,$sec) = split(':', $hours); $date = date(r, mktime($hour, $min, $sec, $month, $day,$year));$item-date = $date;$item-source = source;$item-author = author; $rss-addItem($item);}$rss-saveFeed();?Thanks-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador

RE: Quest for the holy grail of the cakePHP-Eclipse setups

2006-11-09 Thread Adrian Godong
still need to tackle the debugging features. Haven't really tried some unit testing integration. On 11/9/06, Adrian Godong [EMAIL PROTECTED] wrote: Hi, I'm using Eclipse 3.2.0 + PHP plugin from Eclipse (not PHPEclipse) Local workspace setup is just like your number 1. I will have one cake lib

Re: Quest for the holy grail of the cakePHP-Eclipse setups

2006-11-08 Thread Adrian Godong
. Cheers,Sonic -- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com

RE: How to display Child categories of self-pointed Model?

2006-11-04 Thread Adrian Godong
You should change the name of the 'association'. E.g.: ... var $belongsTo = array( 'ParentCategory' = array('className' = 'Category', ... And ... var $hasMany = array( 'ChildCategory' =

Re: how to call a function when somebody click a link?

2006-11-03 Thread Adrian Godong
a function in advance:(maybe i should learn more about basic php?-- Adrian Godong[EMAIL PROTECTED]Microsoft Student Ambassador --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group

Re: ERROR_Adding an RSS feed using FeedCreator

2006-11-02 Thread Adrian Godong
You're not alone. I'm looking at the same problem.I think it's because the wiki documentation is outdated. The sample from bitfolge.de (the creator of feedreader) mentioned something called saveRss function. Just tried, it works! Change the last line in your rss.thtml: $rss-outputFeed();to

RE: Cake PHP Help

2006-10-31 Thread Adrian Godong
More information about the error? From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Gayathiri Balachandran Sent: 31 Oktober 2006 13:43 To: cake-php@googlegroups.com Subject: Cake PHP Help Hello! Please help me in finding answer to this. I am new to Cake