$criteria pagination

2008-02-09 Thread monstercake
hi, i have a question about $criteria as far as the pagination is concerned in the database i have 3 tables table1 (one of the rows is client_id) table2 (one of the rows is client_id) table3 (there is no client_id) my problem is that in the pagination i need to show data from table3 linked to th

Re: Magento cart

2008-02-09 Thread brian_gaff
I was in the IRC Chan recently and someone had mentioned that they were going to port Magneto to CakePHP, you might search the group for "Magneto", also drop in to the IRC Channel and ask, I dont remember who it was. On Feb 9, 10:16 am, cc96ai <[EMAIL PROTECTED]> wrote: > I try on magento, which

Re: Question about finding last record in the database

2008-02-09 Thread brian_gaff
If you just added the record then $this->Model->getLastInserID(); //will give you the id you're looking for Now, suppose you added the record a while ago, and you just want to find the highest ID, then you can add the following to your app_model: function getHighestID() { $res = $this->quer

Re: Question about finding last record in the database

2008-02-09 Thread [EMAIL PROTECTED]
Depending on the database you are working with (mysql, postgres) you could read the documentation and look for a function that returns the last ID I think it's SELECT LAST_INSERT_ID(); On 10 feb, 18:00, Salam Fall <[EMAIL PROTECTED]> wrote: > Just solved the problem > Here is how I have done it >

othAuth on 1.2

2008-02-09 Thread [EMAIL PROTECTED]
Hi there! I've always used othAuth Component but now that I've switched to cake 1.2 I've had some problems, reading on internet I was able to solve almost all of them, but there is a particular one that I havent been able to solve: after the session is ended and user tries to enter in an admin ar

Changing Kids in HasMany (like an Adoption) . . .

2008-02-09 Thread Ben Wilson
I'm not getting this from the documentation, so could somebody point me to an example that shows this? I have a Parent that "hasMany" Children. I also have children belongsTo Parent. I want to change a handful of Children so they have a different Parent. -- Ben Wilson "Words are the only thing

Re: history...

2008-02-09 Thread Ben Wilson
On Feb 9, 2008 8:45 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > I see. Not the way I would do it to be honest, but it's possible... > > What you really want to do is avoid overriding the save method in the > model and use either a beforeSave hook in the model, or writing a > behaviour (1.

Re: history...

2008-02-09 Thread [EMAIL PROTECTED]
I see. Not the way I would do it to be honest, but it's possible... What you really want to do is avoid overriding the save method in the model and use either a beforeSave hook in the model, or writing a behaviour (1.2) that has similar beforeSave hooks in it. I would watch that column quite car

Re: history...

2008-02-09 Thread Ben Wilson
On Feb 9, 2008 6:31 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > if you add created and modified columns to your table, cake will > automagically fill them in for you. But, when I submit a changed record, I want it to do something like the following: save($orig, $new) { $hx = json_deco

Re: Scaffold Templates in 1.2 ?

2008-02-09 Thread Leo Brown
Julio Any idea what revision this was introduced in? Version 6000 didnt have it, but revision 6311 does. The reason i was hoping to know is there there seem to be some session-related bugs in 6311. Thanks guys On Feb 7, 4:46 am, Julio Vinicius <[EMAIL PROTECTED]> wrote: > Hi Wood, i hope t

HABTM for three tables? Modelling problem?

2008-02-09 Thread Joanna Ludmiła Ryćko
Hello, I'm new to the group and new to cakephp. For about two or three weeks I've been trying to create my own app, but I still have some problems with it. Probably with my model, I'm not sure. The fact is: it doesn't work as I would like it to... The problem is about three tables: there are peo

Re: history...

2008-02-09 Thread [EMAIL PROTECTED]
if you add created and modified columns to your table, cake will automagically fill them in for you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@goog

history...

2008-02-09 Thread Ben Wilson
I am storing a row's history in a json_encoded hx field, where each change is a timestamped key. How do I go about putting this behavior in save() so I don't have to do it in every action? -- Ben Wilson "Words are the only thing which will last forever" Churchill --~--~-~--~~---

Re: saveAll with multiple records, {$model}_id is missing

2008-02-09 Thread gerhardsletten
I work with a similar thing right now. The edit view: create('Contentclass');?> input('id'); echo $form->input('title'); echo $form->input('attribute_identifier'); echo $form->input('is_container');

Re: Question about finding last record in the database

2008-02-09 Thread Salam Fall
Just solved the problem Here is how I have done it $ret = $this->Client->query("Select id from clients order by id DESC LIMIT 1"); $newid=$ret[0]['clients']['id'] + 1; $yr=date("y"); $account="$bra

Re: Question about finding last record in the database

2008-02-09 Thread Salam Fall
Here is what i have done so far but it's not working $branch="SEN"; $ret = $this->Client->findBySQL("Select id from clients order by id DESC LIMIT 1"); $lastId=$ret[0]['id']; $act=$lastId + 1;

Question about finding last record in the database

2008-02-09 Thread Salam Fall
Nubee here How do I find the last record in the database and have it's ID value in the controller and be able to manipulate it mathematically. Because all i want to do is put the ID of the last record of the Clients table add 1 to it and append the result to a string that will be used to create

Re: Is there a good solution for this?

2008-02-09 Thread freespac
Hi all thanks for the help.. I a totally beginner in PHP, so bear with me. I have thought a little and put this in my controller function (try to have as little logic in my view as possible) The problem is that it returns blank.. totally blank page, no data at all. I've turned on debbuging wit

Re: Customize html outputted by form helper?

2008-02-09 Thread EchoChargen
I'm not sure what you're asking exactly, but here's an example of using some of the options in the form helper: echo $form->input('phone1', array('label' => array('text' => 'Phone Number', 'class' => 'left'), 'maxLength' => '3', 'before' => '', 'class' => 'phone', 'div' => false )); echo $form->in

Re: Is there a good solution for this?

2008-02-09 Thread Mech7
Ummm it does give allot of overhead to request all comments and only display a few... especially on a high traffic site. On Feb 9, 8:00 pm, MonkeyGirl <[EMAIL PROTECTED]> wrote: > > I want to return only a number of comments (that is defined in > > "visiblecomments") in every story. > > This seem

Customize html outputted by form helper?

2008-02-09 Thread Mech7
Is there a way to template the html generated by the form helper ? --~--~-~--~~~---~--~~ 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 t

Fresh installation error - The action webroot is not defined in controller AppController

2008-02-09 Thread ims
Hi. I have fresh installation of cakephp 1.2 beta and i get this error "The action webroot is not defined in controller AppController" (for more informations click on the link below) http://test.rockretail.com/ I dont configure anything, i only unpack original archive with cake to the sever. Th

Re: Auth Problems

2008-02-09 Thread [EMAIL PROTECTED]
Here is how I solve this problem: if (isset($this->params[Configure::read('Routing.admin')])) $this->Auth->allow( "" ); else { if ($this->action != "login" && $this->action != "logout") //put here any actions you want to deny access to $this->Auth->allow($this->act

Re: Resource Needed: Zend Debugger or Eclipse Debugger for CakePhp

2008-02-09 Thread Dr. Tarique Sani
On Feb 9, 2008 8:21 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Me too in the same boat.. Not able to do it in the komodo ide... I think > that php is not like traditional languages(C, C++). The code flow can't be Once again Xdebug is your friend http://www.thinkingphp.org/2007/09/21/

Re: Is there a good solution for this?

2008-02-09 Thread MonkeyGirl
> I want to return only a number of comments (that is defined in > "visiblecomments") in every story. This seems like an odd way of doing it, as you'd be able to specify how many comments to retrieve, but not which ones... but yes, it's certainly possible. In your story controller, if your use o

Re: Magento cart

2008-02-09 Thread Juan Basso
See the Bakesale: - Project site: http://cakeforge.org/projects/bakesale - Information site: http://www.bakesalehq.com/ Juan Basso On 9 fev, 15:16, cc96ai <[EMAIL PROTECTED]> wrote: > I try on magento, which is pretty good, > I wonder does cake have similar completed cart ? > > coz, i perfer ca

Magento cart

2008-02-09 Thread cc96ai
I try on magento, which is pretty good, I wonder does cake have similar completed cart ? coz, i perfer cake rather than zf framework. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this

Re: Plugin and helper with the same name

2008-02-09 Thread jakecake
Bug report? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more op

Re: can I define a new global function?

2008-02-09 Thread patcoll
You may also want to look at the Set::merge() function if you're using Cake 1.2 ... I've found it's met my needs for doing recursive array merges. p On Feb 8, 6:20 pm, johnnyice <[EMAIL PROTECTED]> wrote: > I grabbed a handy function from php.net (array_merge_recursive_unique) > that I want to u

Re: How to get controller name from an element view?

2008-02-09 Thread Guill3rmo
Thanks a lot, that´s what i was looking for. On 8 feb, 16:22, MonkeyGirl <[EMAIL PROTECTED]> wrote: > > Hi im newbie and my English still sucks, but i want to know get the > > controller name since an element view. Thanks. > > Try echoing out $this->params['controller'] - is that what you're > af

Re: Session expiring when Flash file calls controller method in background

2008-02-09 Thread Novice Programmer
I guess that Flash 9 has got this problem fixed. you can check your module with flash 9. Thanks. On Feb 9, 2008 6:34 AM, skoggins <[EMAIL PROTECTED]> wrote: > > Hmm... looking at core.php I see everything starts with define(...); > > Do I need a different syntax then just plopping > Configure::w

Re: Resource Needed: Zend Debugger or Eclipse Debugger for CakePhp

2008-02-09 Thread Novice Programmer
Me too in the same boat.. Not able to do it in the komodo ide... I think that php is not like traditional languages(C, C++). The code flow can't be noted by the debugger(as php is only interpreted). I am using loggers to debug the controllers. Search my post in the group for debugging. There were p

Indented Select(parent_id)

2008-02-09 Thread Josoroma
If i have the next groups table: DROP TABLE IF EXISTS `bm_groups`; CREATE TABLE `bm_groups` ( `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, `name` varchar(60) DEFAULT NULL, `parent_id` int(11) NOT NULL, PRIMARY KEY (`id`) ) AUTO_INCREMENT=8; INSERT INTO `bm_groups` (`id`, `name`, `pare

Re: user authentication example...login redirects

2008-02-09 Thread duRqoo
var $validate = array( 'name' => array( 'rule' => array('custom', VALID_NOT_EMPTY), 'message' => 'Can\'t be empty' ) ); This is how i deal with not empty values. VALID_NOT_EMPTY may be deprecated, but still it's just a constat so i can replace it wi

Re: Is there a good solution for this?

2008-02-09 Thread duRqoo
AFAIK you can't use variable after LIMIT so u can't get your result set in one call. I would make model function which at first will retrieve visiblecomments number and then use it as value for 'limit' key in options array for find function. On 9. Feb, 03:18 h., freespac <[EMAIL PROTECTED]> wrote

Re: when to use Configure::method() over a DEFINE?

2008-02-09 Thread Mech7
Unless you want to give user control over the search result ;) On Feb 9, 12:58 am, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On Feb 8, 2008, at 4:49 PM, johnnyice wrote: > > > A define is probably what you want, since number of search results > isn't going to change dynamical

Re: user authentication example...login redirects

2008-02-09 Thread MonkeyGirl
> The 'allowEmpty' key should be assigned a boolean value. Ah, thank you. That makes sense. So I've replaced this: var $validate = array( 'name' => array( 'required' => VALID_NOT_EMPTY ) ); With this now: var $validate = array( 'name' => array( array( 'mes