Re: Calling child models in a model NOT work on HABTM?

2009-02-21 Thread Miles J
No its setup with a belongsTo. The columns in the TeamsUser/Players table is: id, user_id, team_id --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googleg

Re: AC_FL_RunContent

2009-02-21 Thread AussieFreelancer
well im wondering if the fact that there are htaccess redirects, as well as a different filestructure, which may affect how this js function is setup, because it works in a normal html file, but it doesn't display in cakephp, even though the paths seem to be fine.. On Feb 21, 5:47 am, mscdex wro

Re: Calling child models in a model NOT work on HABTM?

2009-02-21 Thread mscdex
On Feb 21, 9:39 pm, Miles J wrote: > Im on my Team model (teams table) trying to use the TeamsUser / > Players HABTM. > > $this->Team->TeamsUser->function() AND $this->Team->Players->function > () did not work. Out of curiousity, do you have a HABTM set up in the Players model that points to Tea

AuthComponent : Unable to login and out successively multiple times

2009-02-21 Thread AL
Hello! Did anyone encounter this problem? Unable to login and out with the same account successively multiple times? I am using Auth for authentication for my application. Setup with help from http://www.studiocanaria.com/articles/cakephp_auth_component_users_groups_permissions_revisited But I

Re: Is model calling afterFind on paginate?

2009-02-21 Thread Miles J
You can turn callbacks on or off by declaring it in the find options: 'callbacks' => false http://book.cakephp.org/view/73/Retrieving-Your-Data --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To pos

Is model calling afterFind on paginate?

2009-02-21 Thread tristan_ph
Hi, I would like to ask if Model is calling afterFind on paginate? I have this following code: $this->paginate['Attribute'] = array( 'contain' => array( 'Price' => array('conditions' => 'Price.user_id = ' . $this->Auth- >us

Re: Calling child models in a model NOT work on HABTM?

2009-02-21 Thread Miles J
Im on my Team model (teams table) trying to use the TeamsUser / Players HABTM. $this->Team->TeamsUser->function() AND $this->Team->Players->function () did not work. class Team extends AppModel { /** * Reduce usage */ var $recursive = -1; /**

Re: Calling child models in a model NOT work on HABTM?

2009-02-21 Thread mscdex
On Feb 21, 8:33 pm, Miles J wrote: > Now recently I tried doing this on a HABTM association and I get the > "Model "Child" is not associated with model "Parent"" error. So are we > not able to do this with HABTM relations? Just want to clarify and see > if im doing something wrong. Post your cod

Calling child models in a model NOT work on HABTM?

2009-02-21 Thread Miles J
So I know its possible to call a child model, from the parent model if it is set in a hasOne, hasMany, belongsTo, like so: function Profile extends AppModel { var $hasOne = array('User'); } $this->Profile->User->find(); Now recently I tried doing this on a HABTM association and I get the "Model

Re: two LIKE in paginate

2009-02-21 Thread Miles J
$this->paginate('table', array( 'OR' => array( 'table.name LIKE' => '%word%', 'table.name LIKE' => '%word%' ) )); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePH

Re: combination of validation in model and behaviour?

2009-02-21 Thread mscdex
On Feb 21, 2:42 pm, "Mark (Germany)" wrote: > maybe i didnt understand you in the first place > > do you want me to move both validation rules to the $validate? model > internal and behaviorial validation rules? > or only the first ones? > i could try that - the beh. rules must stay though to acc

Re: Question to Database relations $hasMany and belongsTo

2009-02-21 Thread amarradi
Thanks But there are no change... :( The Error is the same, I think i implement my own searchengine, i believe this is the problem A Question What does this code do? This : $users = $this->Translate->User->find('all'); $this->set('user', $users); many greetings Marcus Radisch --~--~---

Re: combination of validation in model and behaviour?

2009-02-21 Thread Mark (Germany)
maybe i didnt understand you in the first place do you want me to move both validation rules to the $validate? model internal and behaviorial validation rules? or only the first ones? i could try that - the beh. rules must stay though to accomplish the way this captcha is supposed to work On 2

Re: two LIKE in paginate

2009-02-21 Thread mscdex
On Feb 21, 6:14 am, himynameisjonas wrote: > Hi, im trying to do a paginate with two LIKE conditions example: > "...WHERE table.name LIKE %foo% OR table.name LIKE %bar%.." > > But i can't make the pageinate function handle two LIKE with OR, it's > always uses an AND instead. > > any solution? Fo

Authentication bypassed due to camel-cased naming of functions

2009-02-21 Thread RKS
Hi friends, I am a new user of CakePHP, and just finished the tutorials. I created a small application for testing and found out a problem and also its cause, its just that I dont know if it is a real problem or not. Here are relevant details :- 1. I have just 2 models : 'User' and 'Group' 2. Tw

Re: HABTM problem

2009-02-21 Thread brian
> here my question comes: > as more ppl are added in the tags table i added another column > tag_id namefamilyname > -- > 1 DavidBeckham > 2 John Terry > 3 Christano Ronaldo > 4

Re: Create .xls file

2009-02-21 Thread Gonzalo Servat
On Sat, Feb 21, 2009 at 11:45 AM, ykyuen wrote: > > > halo, > > i try to follow the following the instruction to create a simple .xls file. > http://bakery.cakephp.org/articles/view/excel-xls-helper > > i have created > 1. \app\views\helpers\xls.php > 2. \app\views\\excel.ctp (View Template) > 3.

HABTM problem

2009-02-21 Thread ykyuen
halo, i have a question about the HABTM relationship let me use the most common example on web there are 3 table database: 1. posts (post_id, name) 2. posts_tags (post_id, tag_id) 3. tags (tag_id, name) and let's take a look on the tags table tag_id name --- 1

Create .xls file

2009-02-21 Thread ykyuen
halo, i try to follow the following the instruction to create a simple .xls file. http://bakery.cakephp.org/articles/view/excel-xls-helper i have created 1. \app\views\helpers\xls.php 2. \app\views\\excel.ctp (View Template) 3. function excel() {} (an empty fucntion in the corresponding control

Linkable Behaviour pagination

2009-02-21 Thread geoff
Hey all. I've been searching until my eyes have bled, and I haven't been able to find a solution to this issue. I'm currently trying to use the Linkable behaviour in Cake, in order to take it a bit easier on my database. I retrieve the results just fine, however, it is the pagination that refuses

Re: Question to Database relations $hasMany and belongsTo

2009-02-21 Thread James Louie Puro
You said in your previous post that you are having an index error User not found... right? Honestly, I haven't tried using the searchable behaviour...but try adding (below) in your function search action. $users = $this->Translate->User->find('all'); $this->set('user', $users); and do the foreac

Problem with selecting value from select helper

2009-02-21 Thread Maulik
hi to all there is a problem that i hv created a helper of different cities but when i try to edit the user profile form then the helpers values could not locate on that page.. give me the right way for it thanks --~--~-~--~~~---~--~~ You received this message becau

Re: Question to Database relations $hasMany and belongsTo

2009-02-21 Thread amarradi
Thanks for the help here my models First the User array('notempty'), 'password' => array( 'rule' => array('between', 6,64), 'message' => 'Ihr Passwort muss mindestens 6 und darf höchstens 64 Zeichen lang sein.', 'required' => true

Re: Question to Database relations $hasMany and belongsTo

2009-02-21 Thread James Louie Puro
What is your Model relation for User and Translate? is it like this? function User extends AppModel { var $name = 'User'; var $hasMany = array('Translate'); } and function User extends AppModel { var $name = 'User'; var $belongsTo = array('User'); } also post your view controller action. have

Re: two LIKE in paginate

2009-02-21 Thread Aivaras
Note: I am not sure if this is a correct solution, but you can try this: $data = $this->paginate('Recipe', array('Recipe.title LIKE' => 'a%', 'Recipe.recipe LIKE' => 'tasty%')); Hope this helps, Faifas On Sat, Feb 21, 2009 at 13:14, himynameisjonas wrote: > > Hi, im trying to do a paginate w

Question to Database relations $hasMany and belongsTo

2009-02-21 Thread amarradi
Hello together, i've an Problem I have an Database with 2 Tables on table called translates and one table called users so a user can add many translations und a Translation can only be add from one user. How do i connect the Tables my translates has a field user_id as forgeign key the add i

two LIKE in paginate

2009-02-21 Thread himynameisjonas
Hi, im trying to do a paginate with two LIKE conditions example: "...WHERE table.name LIKE %foo% OR table.name LIKE %bar%.." But i can't make the pageinate function handle two LIKE with OR, it's always uses an AND instead. any solution? --~--~-~--~~~---~--~~ You

Re: Debug off denies access to login page

2009-02-21 Thread Adam Royle
Try debugging by putting logging statements in your code step by step and see what you get. $this->log('yayaya'); And you can check them inside app/tmp/logs/ Cheers, Adam - Original Message - From: "benjam" To: "CakePHP" Sent: Saturday, February 21, 2009 8:15 PM Subject: Debug off

Debug off denies access to login page

2009-02-21 Thread benjam
I have a site that uses ACL and Auth to control access to the admin portion of the site, as well as one other non-admin page. When I have debug set to 2, I can log in and access the admin fine, and when I'm logged off, it blocks everything as it should. When I turn debugging off, and try to acce

Date function weirdness in vies

2009-02-21 Thread Joe
So I'm passing a unix timestamp from a database query in my model to my view. I'm using the date() function in the view to format it. I go to the page and it'll display a time like 10:00pm, I hit refresh, and then it displays a time an hour before, at 9:00pm. I'll refresh a few more times and it'l