RE: Validation of a related Model

2007-04-21 Thread Mariano Iglesias
Sounds like now is the perfect time, don't let gwoo down ;) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.Mari

association with mysql View

2007-04-21 Thread sumanpaul
Ok the situation is bit complicated (to me atleast :P) I will try my best to explain . 1. I am using cake 1.2 2. Windows env, apache, mysql, php 5 Now I am making a personal financing app, where i have users, transactions, tables. I am storing all transaction with user_id and I have hasMany rel

Re: Validation of a related Model

2007-04-21 Thread Dr. Tarique Sani
This happens because Controller::render does not pass $this->validationErrors to the View but jumps through several hoops passing $this->{$modelname}->validationErrors to the View instead. I was supposed to write a test to demo this flaw but sorry never got around to it. The following thread is t

Re: Passing arguments to a nested element

2007-04-21 Thread Gonzalo Servat
On 4/22/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > > You are right, view vars will be passed along to elements, but he was > asking > about vars directly passed from the view to the element. Otherwise you are > right, and there's no more he has to do than simply use the view variable. I

RE: where to change or add 'This field cannot be left blank' such validate msg?

2007-04-21 Thread Mariano Iglesias
Since you are using CakePHP 1.2, you have two options: 1. If you are not using input() to create your field, then you can use the second parameter when calling error(), like so: label('Model/field'); ?> text('Model/field'); ?> error('Model/field', 'My error message'); ?> 2. If you are using inp

RE: Passing arguments to a nested element

2007-04-21 Thread Mariano Iglesias
You are right, view vars will be passed along to elements, but he was asking about vars directly passed from the view to the element. Otherwise you are right, and there's no more he has to do than simply use the view variable. -MI -

Re: where to change or add 'This field cannot be left blank' such validate msg?

2007-04-21 Thread dericknwq
In your $validate array, do something like $validate = array( 'fieldname' => array( 'allowEmpty' => false, 'message' => 'Boo, enter something yea?', 'rule' => 'blank' ) ); On Apr 22, 10:46 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > where to change or add 'This field can

RE: Validation of a related Model

2007-04-21 Thread Mariano Iglesias
Can you create a ticket for this? https://trac.cakephp.org Don't forget to mention your Cake version number on the appropriate field. Also if it's not too much effort create another ticket mentioning the error you got when you tried using dot notation. Thanks! -MI --

Re: Passing arguments to a nested element

2007-04-21 Thread dericknwq
If I'm not wrong, your viewVars are always passed to the element. So in fact once you've set the vars using $this->set() on your controller, all the elements could receive those variables as well even if you don't specifically provide the params when calling renderElement. That said, I may have m

Re: Global css navigation menu from DB

2007-04-21 Thread double07
So I'm having a crack at using a component. My component (nav.php) looks like this: class NavComponent extends Object { var $menu = null; function doNav() { $this->menu = "testing"; //just for testing purposes } } In my app_controller.php I have: class AppControll

Re: Validation of a related Model

2007-04-21 Thread Gonzalo Servat
On 4/22/07, Gonzalo Servat <[EMAIL PROTECTED]> wrote: > > On 4/22/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > > > > > Try: > > > > tagErrorMsg('User/Member/field') > > > I tried this before posting actually, as I thought it was worth a shot. > Then I went and looked at the tagErrorMsg() cod

Re: Validation of a related Model

2007-04-21 Thread Gonzalo Servat
On 4/22/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote: > > > Try: > > tagErrorMsg('User/Member/field') I tried this before posting actually, as I thought it was worth a shot. Then I went and looked at the tagErrorMsg() code to see how it uses the first argument, but eventually gave up as I wasn'

RE: Validation of a related Model

2007-04-21 Thread Mariano Iglesias
Try: tagErrorMsg('User/Member/field') or actually whe dot notation which is what you should be using instead: tagErrorMsg('User.Member.field') Try it and let me know, I remember fixing something related to inner model validation error messages but can’t remember on which branch. -MI

Re: mod_rewrite Problem

2007-04-21 Thread cake php
Hi i also have one problem with mod_rewrite( i am not sure). i use iis5 and apache, both disable mod_rewrite. i delete .htaccess files. and uncomment DEFINE in core.php. The same blog tutorial in cakephp manual. routes.php: $Route->connect('/', array('controller'=>'posts', 'action'=>'inde

findNeighbours Confusion

2007-04-21 Thread Andrew
Hi I'm trying to implement a simple gallery, which so far has gone well. I'm now trying to create next/prev links when viewing the individual images, which findNeighbours was clearly made for! :) I'm getting confused over the parameters I need to pass it though: // image_controller.php function

where to change or add 'This field cannot be left blank' such validate msg?

2007-04-21 Thread [EMAIL PROTECTED]
where to change or add 'This field cannot be left blank' such validate msg? I am using .1.2xx ,it seems like nowhere to edit this kind msg. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post

Validation of a related Model

2007-04-21 Thread Gonzalo Servat
Hi All, I have a situation where my main User model will also save one of 3 other Models. The very first model that needs to be saved is "User" and then 0 or more other models get saved. For example: if( $this->User->save($this->data) && $this->User->Member->save($this->data)) { // success }

Re: Passing arguments to a nested element

2007-04-21 Thread Gonza
Hi Mariano, Gracias. Like you said, it's not the most elegant solution but it'll probably work. Thanks! Gonzalo On Apr 21, 8:55 pm, "Mariano Iglesias" <[EMAIL PROTECTED]> wrote: > You can do it through a quick hack, though it is not very elegant. Let's say > that on your view you have: > > rend

Re: multi-page forms

2007-04-21 Thread Chris Lamb
keymaster wrote: > One has to first do a proper search for the solution. One does not simply search into Mordor. -- Chris Lamb, Leamington Spa, UK GPG: 0x634F9A20 signature.asc Description: PGP signature

RE: Passing arguments to a nested element

2007-04-21 Thread Mariano Iglesias
You can do it through a quick hack, though it is not very elegant. Let's say that on your view you have: renderElement('element1', array('arg1' => 'Hello', 'arg2' => 'World')); ?> And element1 includes element2. Element2 looks like: Then the hack is to make element1 look like: viewVars), arr

Re: Passing arguments to a nested element

2007-04-21 Thread Gonzalo Servat
On 4/21/07, Samuel DeVore <[EMAIL PROTECTED]> wrote: > > > one of my favorite php functions these days is http://php.net/compact > Thanks for the suggestion. I'm not quite sure how compact will help me, though. Lets consider this example: $this->renderElement('element', array('arg1' => 'val1', 'a

Re: Different layouts for each action on the same controller

2007-04-21 Thread the_woodsman
Once you´re comfortable switching layout like that, you could then do this dynamically in the beforeFilter of your controllers. For example, check if a layout exists with a name corresponding to this controller & action, and if not, check for one for this controller, then as a last resort use the

Re: Display multiple levels with adjacency list model

2007-04-21 Thread Poncho
Hey guys, I found a recursive function (by CraZyLeGs) to re-write the results array to allow for multiple levels on the cake trac system (https:// trac.cakephp.org/ticket/486). I have modified the original code slightly, to insert into my AppModel. function getTree($conditions=null, $fields=nul

one problem in my blog domo. please help me!

2007-04-21 Thread cake php
Hi friends, i am a fresh man of cakephp. i got one problem when i create the Blog Demo following the steps in cakephp manual. The index page display as supposed, the url is :http://localhost/ index.php but when i click the link to the sub founction page. (other action rather than index). view; e

Re: Cake app not running, index.php offered for download

2007-04-21 Thread Daniel Kvasnicka jr.
Problem solved, Cake couldn't connect to MySQL through a port number I was given by client. Port number removed, works like a charm. Dan On Apr 20, 3:08 pm, byBartus <[EMAIL PROTECTED]> wrote: > I was having similar problem, so i defined ('DEBUG', 2) in core.php in > the live app and magically i

Re: multi-page forms

2007-04-21 Thread keymaster
One can't just request $1M on this forum urgently and expect to be answered. One has to first do a proper search for the solution. Kindly post your solution if you figure it out. :-)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to

R: when I create my own layout file ,where to put all the related pics and swfs?

2007-04-21 Thread m.sbragi
To be shure to point to correct url if you have inner path from webroot or if you move your you can use this tip (so if images are correctly referenced even swf will be): If swf/ and img/ are at the same level use: $pathToSwf = $html->image('../swf/theFileIsHere.swf'); Or you simply put your s

Discussion on cake-apps-sites-in-the-wild

2007-04-21 Thread xbase
You can also add my site. http://www.xbaseinc.com - XBASE, Inc. I'm releasing two applications over the next month and two more sites built with cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" grou

when in 2.0xx using paginate,how to specific the paging conf?

2007-04-21 Thread [EMAIL PROTECTED]
like 5 items a page ,somethin like that. --~--~-~--~~~---~--~~ 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

I cant get my js file work?where to put js files?

2007-04-21 Thread [EMAIL PROTECTED]
where to put js files? and how to refence it? --~--~-~--~~~---~--~~ 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 ema

Re: Passing arguments to a nested element

2007-04-21 Thread Samuel DeVore
one of my favorite php functions these days is http://php.net/compact On 4/21/07, Gonzalo Servat <[EMAIL PROTECTED]> wrote: > Hi All, > > Say I have: > > $this->renderElement('element', array('arg1' => 'val1', 'arg2' => 'val2')); > > Once inside element.thtml , how could I render another element

Re: hasMany's order question

2007-04-21 Thread matlin
The BlogsController: http://bin.cakephp.org/view/616075649 and the CategoriesController: http://bin.cakephp.org/view/1748048905 Staring myself blind I think ... ;) On Apr 21, 1:44 am, gerbenzomp <[EMAIL PROTECTED]> wrote: > What is your current code? > > On 21 apr, 00:26,matlin<[EMAIL PROTECTED

javascript->link not working as it should

2007-04-21 Thread Martin
I've been using cake 1.1 for a wile. Now I'm trying to migrate to cake 1.2 (latest version) and I have this problem. My app is in /var/www/test/app/ I'm trying to include a js file from my layout (default.ctp). The js file is in app/webroot/js/test.js my code in the layout is echo ""; echo "\

Re: Global css navigation menu from DB

2007-04-21 Thread double07
I still get this error: Notice: Undefined property: PagesController::$Node in C:\wamp\www\cake \app\app_controller.php on line 51 Fatal error: Call to a member function findAllThreaded() on a non- object in C:\wamp\www\cake\app\app_controller.php on line 51 I tried it in \app and \app\controllers

Passing arguments to a nested element

2007-04-21 Thread Gonzalo Servat
Hi All, Say I have: $this->renderElement('element', array('arg1' => 'val1', 'arg2' => 'val2')); Once inside element.thtml, how could I render another element and pass whatever arguments were passed onto the main element? (ie. arg1, arg2 in this case) I thought of a (untested) workaround, but, i