contain/bindModel

2009-10-10 Thread lorenx
hi all, i have a deep model association handle by the containable behaviour: ModelD hasMany ModelDF ModelD belonsTo ModelDS ModelDF belongsTo ModelD, ModelDSF ModelDS hasMany ModelD, ModelDSF var $contain = array( 'DS' => array( 'DSF' => array( 'DF

Re: javascript link in default.ctp

2009-09-30 Thread lorenx
ok, i'm going to try. thanks a lot! On Sep 30, 5:46 pm, brian wrote: > On Wed, Sep 30, 2009 at 11:01 AM, lorenx wrote: > > > do i have to create it or to copy cake/libs/controller/ > > app_controller.php so that cakephp will read mine from now on? > > Yeah, copy th

Re: javascript link in default.ctp

2009-09-30 Thread lorenx
e doing. > > // lundvall > > On 30 Sep, 13:16, lorenx wrote: > > > mmm, > > i have just these two: > > > cake/libs/controller/app_controller.php > > cake/console/libs/templates/skel/app_controller.php > > > On Sep 30, 11:41 am, "rich...@hom

Re: javascript link in default.ctp

2009-09-30 Thread lorenx
php > > class AppController extends Controller { > >     var $helpers = array("Html", "Form", "Javascript"); > > } > > On Sep 30, 9:17 am, lorenx wrote: > > > > > m, ok... > > i raised the issue just because the cookboo

Re: javascript link in default.ctp

2009-09-30 Thread lorenx
m, ok... i raised the issue just because the cookbook says "not to edit files in cake/ folder"... thanks. On Sep 30, 2:12 am, brian wrote: > On Tue, Sep 29, 2009 at 5:07 PM, lorenx wrote: > > > sure but... > > is there a way to do it in the app/ area? > > Do

Re: formhelper: deep model values

2009-09-29 Thread lorenx
i'm sorry for my perseverance but... the FormHelper magic is really limited just to one-level recursion? On Sep 26, 8:52 pm, lorenx wrote: > me again... > > i found the following link (i'm not using the $uses controller > attribute) and i did some tests:https://trac.c

Re: javascript link in default.ctp

2009-09-29 Thread lorenx
var $helpers = array('Javascript'); > > } > > // lundvall > > On 29 Sep, 19:57, lorenx wrote: > > > > > hi all, > > i'm wondering one thing: > > i understand the choise to call helpers only when needed but... if i > > want to include

javascript link in default.ctp

2009-09-29 Thread lorenx
hi all, i'm wondering one thing: i understand the choise to call helpers only when needed but... if i want to include a javascript file in the default.ctp (the common layout used everywhere), i have to call the javascript helper in every controller of my application? thanks. --~--~-~--~--

Re: simple "contain" question

2009-09-26 Thread lorenx
On Sep 25, 10:00 pm, brian wrote: > Do you mean that you only want that one model to implement it? Yes, > you can do that. The syntax is exactly the same as with AppModel: > > var $actsAs = array('Containable'); > > or (PHP5 only) > > public $actsAs = array('Co

Re: formhelper: deep model values

2009-09-26 Thread lorenx
father['TestChild'] as $subkey => $child): echo $form->input('TestFather.'.$key.'.TestChild.'.$subkey.'.name'); echo $form->input('TestFather['.$key.'][TestChild]['.$subkey.'] [name]'); endforeach

Re: simple "contain" question

2009-09-26 Thread lorenx
ok, i follow your advice and i stop here. thank a lot, really! On Sep 26, 4:45 pm, brian wrote: > On Sat, Sep 26, 2009 at 10:36 AM, lorenx wrote: > > > ok, just to make sure we understand each other :) > > > the following is not correct: > > > class ModelA ext

Re: simple "contain" question

2009-09-26 Thread lorenx
awesome, cause i now have a ModelB property set in the ModelA... correct me if i am wrong) thanks again! On Sep 26, 4:03 pm, brian wrote: > On Sat, Sep 26, 2009 at 9:38 AM, lorenx wrote: > > > sorry... > > > and if i need something like this > > > '

formhelper: deep model values

2009-09-26 Thread lorenx
hi all, again. i have a $form->data populated with models deeply related and i'm not able to take full advantage of the formhelper magic. in the last part of the form i use foreach to cycle on the deep models and i refer to them with: 'ModelA.ModelB.'.$i.'.ModelC.0.field' but nothing happens. i

Re: formhelper: deep model values

2009-09-26 Thread lorenx
sorry but... the FormHelper magic is limited just to one-level recursion? On Sep 26, 12:34 pm, lorenx wrote: > hi all, again. > > i have a $form->data populated with models deeply related and i'm not > able to take full advantage of the formhelper magic. > > in the l

Re: simple "contain" question

2009-09-26 Thread lorenx
), 'HtmlInputType', 'order' => $this->OtherModel->order ) ) ) is that the correct way to refer to the OtherModel property or not... On Sep 26, 3:32 pm, lorenx wrote: > ...and s

Re: simple "contain" question

2009-09-26 Thread lorenx
this->YourModel->contain > > > > On Sat, Sep 26, 2009 at 5:50 AM, lorenx wrote: > > > sorry... i didn't explain it well at all! :P > > i meant this: if it is possible to set in the model file the "contain" > > array with all the details; > &

simple "contain" question

2009-09-25 Thread lorenx
hi all. is it possible to set the containable behaviour of a model in its model file? just to set it once, staticly... maybe with the ability to change it on the fly when needed... thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: recursive find: related models order

2009-09-24 Thread lorenx
ok, thank you very much! On Sep 24, 1:58 pm, Bert Van den Brande wrote: > If I understand you question correctly I think you're right :) > > > > On Thu, Sep 24, 2009 at 1:27 PM, lorenx wrote: > > > perfect, thanks! > > > just one little question: > >

Re: recursive find: related models order

2009-09-24 Thread lorenx
Brande wrote: > Search the Cake book for 'Containable' behavior , I think you will find your > answer there > > > > On Thu, Sep 24, 2009 at 10:53 AM, lorenx wrote: > > > hi all. > > > i'm trying to order a deeply related model but the followin

recursive find: related models order

2009-09-24 Thread lorenx
hi all. i'm trying to order a deeply related model but the following code gives me an error. $params = array( 'order' => 'RelatedModel.relatedmodel_field DESC', 'recursive' => 3 ); $models_array = $this->Model->find('all', $params); i saw that cakephp do several queries to build

Re: form date/ time

2009-09-21 Thread lorenx
array( 'type'=>'datetime', 'label' => 'validity date from', 'selected' => $this->data['Dpage']['validity_date_from'], 'empty' => true )); well, that's all. thanks to

form date/ time

2009-09-20 Thread lorenx
hi all. i'm dealing with dates. in my form i would like to edit a DATE database field with the chance to save a null (or empty) value and, of course, the current option, if present, selected. this code does not display a label and i'm not able to pre-select the current database value: echo $form

Re: some newbie questions

2009-09-19 Thread lorenx
;                         } else { >                                 $this->set('model', $this->Model->read(null, > $id)); >                         } >                 } >         } > > It's really just a style of coding that increases clarity (or not, as > the case may be ;) ). > > On S

Re: some newbie questions

2009-09-19 Thread lorenx
> 1. Cake's reading the id from the url. You're saying, in the url, > 'show me the Post controller / the View method / and record number > #n', and Cake's handling that for you automatically. sure but... what if i comment out all the $id reference? this cleaned code: function view() { $th

Re: some newbie questions

2009-09-19 Thread lorenx
moving from one place to another, so you > can act on specific fields by calling $this->data['Model']['field']. > > Hope this helps! > > On Sep 17, 7:05 pm, lorenx wrote: > > > > > hi all, > > i'm new to cakephp and, mentioning the bl

Re: some newbie questions

2009-09-18 Thread lorenx
a little help please? On Sep 17, 8:05 pm, lorenx wrote: > hi all, > i'm new to cakephp and, mentioning the blog tutorial, i have some > simple questions. > > 1. > in the sample controller, there is the view action: > > function view($id = null) { &g

Re: little newbie question

2009-09-17 Thread lorenx
->id = $id; > > Rick > > On Sep 16, 3:45 pm, lorenx wrote: > > > > > hi all, > > i'm new to cake so, if you think that a better place exists for my too > > simple questions... just let me know. > > > following the blog tutorial i did some tests

some newbie questions

2009-09-17 Thread lorenx
hi all, i'm new to cakephp and, mentioning the blog tutorial, i have some simple questions. 1. in the sample controller, there is the view action: function view($id = null) { $this->Post->id = $id; $this->set('post', $this->Post->read()); } to better understand, i did some tests

little newbie question

2009-09-16 Thread lorenx
hi all, i'm new to cake so, if you think that a better place exists for my too simple questions... just let me know. following the blog tutorial i did some tests to better understand how cakephp works; in the following code: [code] function view($id = null) { $this-MyObj>id = $id;