Re: No validation after deploy

2010-05-20 Thread Andrei Mita
Do you use model validation or a custom made one? On Thu, May 20, 2010 at 9:58 PM, Matteo wrote: > Hi all, > > hope you can help a very newbe one. > > I have a very simple form with two fields: title and body. > > In my dev enviroment I check for the two fields to be fill. > Validation works fi

ideas for handling user added images

2010-05-20 Thread mikeottinger
Hi All, I have a site that allows the user, through an admin section, the ability to upload his own images to the site, a very poor man's CMS if you will. This has all worked pretty well but for one annoying aspect that I finally want to address. Currently all uploaded images are placed in app/w

Re: Help with User - Friend HABTM relationship

2010-05-20 Thread bradmaxs
Thank you Calvin. Working hard to figure all of this out and your suggestion was exactly what I was looking for. I will be working on this tomorrow and let you know how it works out. On May 20, 6:36 pm, calvin wrote: > That's a PHP question, not a Cake question. > > If you want to combine the a

Re: please any one can help me to convert this complex query in to cakephp

2010-05-20 Thread jmcneese
$campaigns->find('all', array( 'fields' => array( 'Campaign.campaign_id', 'Campaign.supplier_id', 'Campaign.brand', 'Campaign.end_date' ), 'joins' => array( array( 'type' => 'INNER', 'table'

noob question, how to add a button(to link somewhere) to a form

2010-05-20 Thread Jay
Hi guys, I have 2 MVC classes A and B. Where B has a foreign key reference to A. In A's view controller, I have a working Add page. In B's view controller, I'm writing the add page(add.ctp) using forms and I want to have a button where it links to A's add page, how would I be able to do that? Pleas

No validation after deploy

2010-05-20 Thread Matteo
Hi all, hope you can help a very newbe one. I have a very simple form with two fields: title and body. In my dev enviroment I check for the two fields to be fill. Validation works fine, if the fields are left blank, it shows the message error. The problem is with deploy. In my deploy env. (drea

Re: Find Question - field()

2010-05-20 Thread calvin
I mean referencing the model object itself, i.e. $this->User->find() instead of $model->find() or User->find(). On May 20, 10:18 am, bradmaxs wrote: > Thanks Calvin. > > When you say access models from controllers, do you mean with find(). > > Trying some different methods as we speak. > > On Ma

Re: Help with User - Friend HABTM relationship

2010-05-20 Thread calvin
That's a PHP question, not a Cake question. If you want to combine the arrays, then just combine them like you would any other array. If you have: $friends = array('friend 1', 'friend 2', 'friend 3', ...); $admirers = array('admirer 1', 'admirer 2', 'admirer 3', ...); how would you combine them

Re: Theme Problem

2010-05-20 Thread Davor Ilic
no i didn´t because i didn´t where to throw the file i createt but i know now where and how. 2010/5/21 calvin > You're not following Cake's naming/directory structure conventions for > themes: > http://book.cakephp.org/view/1093/Themes > > On May 20, 1:57 pm, Davor Ilic wrote: > > Hi All, > >

Re: Theme Problem

2010-05-20 Thread calvin
You're not following Cake's naming/directory structure conventions for themes: http://book.cakephp.org/view/1093/Themes On May 20, 1:57 pm, Davor Ilic wrote: > Hi All, > > i have some trobles with the theme. > > i get always the default theme from cakePHP. > > i used this in my UserController: >

Re: cake 1.2 problem with cache

2010-05-20 Thread back2maximum
None of these solutions worked for me, but you can disable caching all together by adding the line Configure::write('Cache.disable', true); to your core.php file. tiadev wrote: > > > hello, i updated the nightly last release cakephp 1.2 bêta but i have > a problem with cache when i separate t

Re: my link looks like this app/webroot/index.php/

2010-05-20 Thread Davor Ilic
have anyone this problem exept me :) ? And found some solution then please help me out. 2010/5/19 Davor Ilic > Hi All, > > i have the problem if i use from helpers the "$html->link" i get this > link app/webroot/index.php/ and i do not know why because i didn´t change > anything. > i changed o

Theme Problem

2010-05-20 Thread Davor Ilic
Hi All, i have some trobles with the theme. i get always the default theme from cakePHP. i used this in my UserController: var $view = 'Theme'; var $theme = 'wf'; and i also try for some actions $this->theme = 'wf'; it also didnt work. and the folder i have used "/view/wf/wf.ctp " what i´ve

Re: data validations

2010-05-20 Thread John Andersen
Well, if you have a reason for that non-CakePHP structure, then I can't help you! Enjoy, John On May 20, 10:10 pm, Emanuele Gringeri wrote: > Thanks for ur answer, but for some reason I have to manage data like > $this->data[A][B][email] > > thanks > emanuele > On 05/20/10 16:59, John Andersen

Re: Help with User - Friend HABTM relationship

2010-05-20 Thread bradmaxs
Anyone able to help me on this? On May 18, 4:55 pm, bradmaxs wrote: > Hello All, > > In response to the following post: > > http://groups.google.com/group/cake-php/browse_thread/thread/c8ebc209... > > I have come up with my users having friends and admirers, thank you > gentlemen for that. > > I

Re: Problem with Session->setFlash

2010-05-20 Thread Jeremy Burns
Seems like overkill to me. Just use $this->Session->setFlash('Here is my message'); Then do echo $this->Session->flash(); - this not only displays your message but also clears it out of the cache. Jeremy Burns jeremybu...@me.com On 20 May 2010, at 18:16, sami_bk wrote: > Hi all, > > I am ne

Problem with Session->setFlash

2010-05-20 Thread sami_bk
Hi all, I am new to CakePHP and i am building a small app. i use Session->setFlash('message') to display notifications to the users . The notification is displayed in the default layout and i delete the flash messega from the session using this code if ($session->check('Message.flash')) { $me

Unitesting with Simpletest

2010-05-20 Thread Aung
Hi team, I have been using cakephp for one of my projects and we are trying to test with Simpletest as provided in the documentation. However, our api cannot be called directly. We have to use * Method: POST * Header Name: Content-Type * Header Value: application/x-www-form-urlencoded

Re: Name Convention Problem in creating model please help me out

2010-05-20 Thread Miles J
Table: stores, Model: Store Table: test_stores, Model: TestStore On May 20, 6:52 am, John Andersen wrote: > The naming conventions states that your models should be singular, > your tables plural. So you model for the stores table must be Store - > not Stores! > > Your table test_stores will be s

Re: HABTM find query trouble

2010-05-20 Thread dw
The fundamental issue i see with your find statement: $markets = $this->Property->Market- >find('all','conditions'=>array('Property.id'=>$id)); is that you are looking for 'Property.id' on the market table. you need to change it to: $markets = $this->Property->Market- >find('all','conditions'=>a

Re: Find Question - field()

2010-05-20 Thread bradmaxs
Thanks Calvin. When you say access models from controllers, do you mean with find(). Trying some different methods as we speak. On May 20, 4:07 am, calvin wrote: > Assuming that's exactly what your code looks like, the > T_OBJECT_OPERATOR error is probably because you're putting a > T_OBJECT_OP

Re: data validations

2010-05-20 Thread Emanuele Gringeri
Thanks for ur answer, but for some reason I have to manage data like $this->data[A][B][email] thanks emanuele On 05/20/10 16:59, John Andersen wrote: > If your model is named A, then your data structure should be: > > [code] > $this->data[A][email] = 'aa'; > $this->data[A][url] = 'www.aa.com'; > [

Re: Problem with data inside an element.ctp when is loaded dynamically

2010-05-20 Thread Andrei Mita
That was my best guess. Sorry :) Take a look at the view source cod after you populate your form just before submission and maybe you'll spot something there. Or, make a debug after you submit your form and see what data is passed to the controller. On Thu, May 20, 2010 at 8:00 PM, kryska wrot

Re: Problem with data inside an element.ctp when is loaded dynamically

2010-05-20 Thread kryska
Yes , i do. first I create the form: $form->create(array('controller'=>'Detallemenu','action'=>'add')); afert i have: And at the end: $form->end(array('label'=>'Crear Menú','class'=>'button')) In fact, if i write $this->element('mielement') inside the div, it works! But i dont know why i

Re: data validations

2010-05-20 Thread John Andersen
If your model is named A, then your data structure should be: [code] $this->data[A][email] = 'aa'; $this->data[A][url] = 'www.aa.com'; [/code] And your validation rules for the A fields, should be: [code] var $validate = array( 'email' => array( 'rule' => 'email', 'message' => 'Pl

Re: Problem with data inside an element.ctp when is loaded dynamically

2010-05-20 Thread Andrei Mita
Do you load the elements in between form->create and form->end? On Thu, May 20, 2010 at 6:01 PM, kryska wrote: > Hi! > There is a view with a form inside. > Two dropdown lists; depending on the first value selected, fill the > second dropdown. And depending on the value selected on the secon >

data validations

2010-05-20 Thread emanuele
hello cakers, I m stucked with a simple issue regarding data validations. Suppose that I ve a model named A: After I submit data, my $this->data would be so composed. eg $this->data[A][B][email] = 'aa'; $this->data[A][B][url] = 'www.aa.com'; I wanto to check both fields. In model i ve defined

Problem with data inside an element.ctp when is loaded dynamically

2010-05-20 Thread kryska
Hi! There is a view with a form inside. Two dropdown lists; depending on the first value selected, fill the second dropdown. And depending on the value selected on the secon dropdown, i load different elements.ctp inside a div. Finally, i end the form: echo $form- >create(array('controller'=>'Det

How do you stop $form->create() from adding the 'id' to it's submit url ?

2010-05-20 Thread keymaster
Obviously one can unset the 'id' field, but there are times we want a value in the id field, yet still not have the form helper insert that value into the url. In the admin_index view, I have the following simple filter form. echo $form->create($model, array( 'url' => array_merge(

Re: swf object in cake

2010-05-20 Thread kangur91
maybe you need this http://code.google.com/p/swfobject/wiki/documentation iIf you want to get param from url use: $this->params['url'] Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subsc

Re: Name Convention Problem in creating model please help me out

2010-05-20 Thread John Andersen
The naming conventions states that your models should be singular, your tables plural. So you model for the stores table must be Store - not Stores! Your table test_stores will be supported by a model named TestStore (singular and camelcased). Enjoy, John On May 20, 4:03 pm, Narendra Padala w

please any one can help me to convert this complex query in to cakephp

2010-05-20 Thread Narendra Padala
Hi All, I am new to cakephp please any one can help me to convert this complex query in to cakephp Query SELECT `c`.`campaign_id`, `c`.`supplier_id`, `c`.`brand`, `c`.`start_date`, `c`.`end_date` FRamOM `campaigns` as `c` LEFT JOIN `campaign_stores`

Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Jeremy Burns
It's TestStore - I just posted a correction. Jeremy Burns jeremybu...@me.com On 20 May 2010, at 14:14, Narendra Padala wrote: > hi here model class name > > Table test_stores: test_store.php, model class TestStores > > > "TestStores" or TestStore. i have doubt let me clarify please > > var

Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
thanq On Thu, May 20, 2010 at 6:44 PM, Narendra Padala wrote: > hi here model class name > > > Table test_stores: test_store.php, model class TestStores > > > "TestStores" or TestStore. i have doubt let me clarify please > > var $name=TestStores; or var $name=TestStore > > > On Thu, May 20, 2010

Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
hi here model class name Table test_stores: test_store.php, model class TestStores "TestStores" or TestStore. i have doubt let me clarify please var $name=TestStores; or var $name=TestStore On Thu, May 20, 2010 at 6:32 PM, Jeremy Burns wrote: > Model conventions: http://book.cakephp.org/vie

Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Jeremy Burns
Correction: model class: TestStore Jeremy Burns jeremybu...@me.com On 20 May 2010, at 14:02, Jeremy Burns wrote: > Model conventions: http://book.cakephp.org/view/901/CakePHP-Conventions > > But in case you can't be bothered to read it, let me spell it out for you. > > Table name - lower case

Name Convention Problem in creating model please help me out

2010-05-20 Thread Narendra Padala
Hi...All i am new to cakephp, i have problem in creating model please help me out...! My table names like this Table one : stores Table two : test_stores For one i create like this. File name: store.php For second table how can i create model help me out.? For "test_store

Re: How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Jeremy Burns
Model conventions: http://book.cakephp.org/view/901/CakePHP-Conventions But in case you can't be bothered to read it, let me spell it out for you. Table name - lower case, plural, underscored. Field names: lowercase, underscored. Model filename: Singular, camel cased. Model class name: Singular,

How create model in cakephp [Naming conventions Problem]

2010-05-20 Thread Narendra Padala
Hi...All i am new to cakephp, i have problem in creating model please help me out...! My table names like this Table one : stores Table two : test_stores For one i create like this. File name: store.php For second table how can i create model help me out.? For "test_store

Re: conditions on how a virtual field is constructed

2010-05-20 Thread calvin
In this case TRIM() is the best solution. But you can also use the IF(condition, "true value", "false value") function, which acts like a ternary operator. On May 19, 7:42 am, fly2279 wrote: > For anyone else looking for a solution to this, I used mysql's trim > function to just trim away the tra

Re: Find Question - field()

2010-05-20 Thread calvin
Assuming that's exactly what your code looks like, the T_OBJECT_OPERATOR error is probably because you're putting a T_OBJECT_OPERATOR ("->") after a constant ("User"). If you want the model, then you need to write $this->User. Likewise, unless you declared a variable previously named $model, callin

Re: HABTM find query trouble

2010-05-20 Thread WebbedIT
Have you started using containable yet? Without testing this it would seem logical that you could run $this->Property->find('first', array( 'conditions'=>array('Property.id'=>$property_id), 'contain'=>array( 'Market'=>'Article' ) )); However this would give you multiple sets of article

Re: Sanitize::clean breaking file uploads

2010-05-20 Thread Michele Ferri
Posting my solution. function edit($id = null) { [...] if (!empty($this->data)) { $img = $this->data['Model']['image']; // save file upload array into a variable before sanitizing $this->data = Sanitize::clean($this->data); // perform sanit

Re: Sanitize::clean breaking file uploads

2010-05-20 Thread Michele Ferri
The file uploads are working fine without Sanitize::clean(). The only solution I see is to handle the file validation/copy logic before executing the sanitization. I'm puzzled. Maybe I should mention that I'm running on my local windows machine using XAMPP. But all the php.ini upload-related variab

Re: Front-end for end-users and admins design

2010-05-20 Thread Andrei Mita
Thank you for enlightening me. I'll do some more reading and come back with questions, most probably :) On Wed, May 19, 2010 at 8:51 PM, calvin wrote: > Due to the reasons explained by WebbedIT, the best thing to do is just > use admin routing. At the minimum, the models used by your admin and