Re: recursive attr in Model not worked in cake2.1

2012-03-12 Thread euromark
one would need to see some actual code, though


Am Dienstag, 13. März 2012 02:54:17 UTC+1 schrieb piku:
>
> I just used cake2.1 ,but Model section when i try to use $this- 
> >Model(alias name)->recursive =1 
> it did not work , but when i used same code in cake 1.3 it works , 
> could any one say is it new bug in cake . 
>
> @cakeLover

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


recursive attr in Model not worked in cake2.1

2012-03-12 Thread piku
I just used cake2.1 ,but Model section when i try to use $this-
>Model(alias name)->recursive =1
it did not work , but when i used same code in cake 1.3 it works ,
could any one say is it new bug in cake .

@cakeLover

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Custom Bake Fails

2012-03-12 Thread gavrielh
I've changed some of the controller actions within the bake template
and cannot seem to get Cake Bake to use these custom templates.  I
have Cake 1.3 installed in the following manner:

/var/www/cakephp(root install, added to environment variables)
/var/www/myapp  (application code)

I copied the cake bake templates from

/var/www/cakephp/cake/console/templates/default

to

/var/www/myapp/vendors/shells/custom

When I navigate to /var/www/myapp and run

cake bake controller person

I end up with the standard out of the box cake controller, not my
custom bake template.

Am I doing something wrong here?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Do I need to load a Model if I reference it in a contain?

2012-03-12 Thread Kro
Okay, I obviously need to get a better understanding of
'contain'...thanks again for taking the time...

On Mar 12, 11:34 pm, euromark  wrote:
> well, If you use it inside a contain there has to be a relation present!
> either in the model - hardcoded in $hasMany/$belongsTo or dynamically via
> bindModel()
>
> but without the relation definition the containable behavior doesnt know
> what to do with it.
>
> Am Montag, 12. März 2012 13:32:32 UTC+1 schrieb Kro:
>
>
>
>
>
>
>
>
>
> > I have removed 'var $uses' from a controller and replaced it with
> > calls to 'loadModel()'. I'm just wondering if I need to load a model
> > which isn't referenced directly in a function, but is referenced in a
> > contain.
> > e.g.
>
> > $contain =
> > array('SurveyResponse'=>array('SurveyQuestion'),'BookingOrder'=>array('Room 
> > ','Rate','AddOnPurchase'=>array('AddOn')));
> > //
> > Association between Booking and SurveyResponse in SurveyResponse Model
> > $this->Booking->contain($contain);
>
> > Is it necessary to load the 'SurveyResponse' Model as it is mentioned
> > in the above contain statement for the Booking Model?
>
> > Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Do I need to load a Model if I reference it in a contain?

2012-03-12 Thread euromark
well, If you use it inside a contain there has to be a relation present!
either in the model - hardcoded in $hasMany/$belongsTo or dynamically via 
bindModel()

but without the relation definition the containable behavior doesnt know 
what to do with it.


Am Montag, 12. März 2012 13:32:32 UTC+1 schrieb Kro:
>
> I have removed 'var $uses' from a controller and replaced it with 
> calls to 'loadModel()'. I'm just wondering if I need to load a model 
> which isn't referenced directly in a function, but is referenced in a 
> contain. 
> e.g. 
>
> $contain = 
> array('SurveyResponse'=>array('SurveyQuestion'),'BookingOrder'=>array('Room','Rate','AddOnPurchase'=>array('AddOn')));
>  
> // 
> Association between Booking and SurveyResponse in SurveyResponse Model 
> $this->Booking->contain($contain); 
>
> Is it necessary to load the 'SurveyResponse' Model as it is mentioned 
> in the above contain statement for the Booking Model? 
>
> Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Do I need to load a Model if I reference it in a contain?

2012-03-12 Thread Kro
Thanks for the reply. So in the above scenario (contain reference to
'SurveyRespose') I would need to load the 'SurveyResponse' Model as it
is not related to the 'Booking' Model?

On Mar 12, 2:25 pm, euromark  wrote:
> no
> not if there is a relation between those models and you properly access it
> via chain:
>
>     $this->Booking->SurveyResponse->find();
> etc
>
> Am Montag, 12. März 2012 13:32:32 UTC+1 schrieb Kro:
>
>
>
>
>
>
>
>
>
> > I have removed 'var $uses' from a controller and replaced it with
> > calls to 'loadModel()'. I'm just wondering if I need to load a model
> > which isn't referenced directly in a function, but is referenced in a
> > contain.
> > e.g.
>
> > $contain =
> > array('SurveyResponse'=>array('SurveyQuestion'),'BookingOrder'=>array('Room 
> > ','Rate','AddOnPurchase'=>array('AddOn')));
> > //
> > Association between Booking and SurveyResponse in SurveyResponse Model
> > $this->Booking->contain($contain);
>
> > Is it necessary to load the 'SurveyResponse' Model as it is mentioned
> > in the above contain statement for the Booking Model?
>
> > Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: MenuBuilder doesn't work with cakephp 2.0 (or 2.1)

2012-03-12 Thread Rob
Strictly speaking, you don't need those helpers for MenuBuilder to work, 
but you are overwriting the default helpers array, so any other code in 
your view that uses those helpers will cease to work. The alternative is to 
push MenuBuilder onto the helpers array in your beforeFilter method.


On Monday, March 12, 2012 9:59:37 AM UTC-4, Thomas wrote:
>
>
> Finally got it to work... What was missing?
>
> Did not know that I have to add "Form" and "Html" Helpers to the $helpers 
> array like this:
>
> var $helpers = array('Forms', 'Html', 'MenuBuilder.MenuBuilder');
>
> After reading the documentation several times I finally found this small 
> sentence:
>
> "Remember to include the default Html and Form helpers"
>
> Too bad this important piece of information was not more obvious (eg. big 
> red letters :-)
>
>
> Am Donnerstag, 8. März 2012 23:38:13 UTC+1 schrieb Rob:
>>
>> You should drop the entire MenuBuilder directory structure into the 
>> Plugin directory. That means that the path for the helper class will end up 
>> being app/Plugin/MenuBuilder/View/Helper/MenuBuilderHelper.php.
>> Plugins do have to be loaded in your bootstrap file. See 
>> http://book.cakephp.org/2.0/en/plugins.html
>>
>>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Do I need to load a Model if I reference it in a contain?

2012-03-12 Thread euromark
no
not if there is a relation between those models and you properly access it 
via chain:

$this->Booking->SurveyResponse->find();
etc


Am Montag, 12. März 2012 13:32:32 UTC+1 schrieb Kro:
>
> I have removed 'var $uses' from a controller and replaced it with 
> calls to 'loadModel()'. I'm just wondering if I need to load a model 
> which isn't referenced directly in a function, but is referenced in a 
> contain. 
> e.g. 
>
> $contain = 
> array('SurveyResponse'=>array('SurveyQuestion'),'BookingOrder'=>array('Room','Rate','AddOnPurchase'=>array('AddOn')));
>  
> // 
> Association between Booking and SurveyResponse in SurveyResponse Model 
> $this->Booking->contain($contain); 
>
> Is it necessary to load the 'SurveyResponse' Model as it is mentioned 
> in the above contain statement for the Booking Model? 
>
> Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: MenuBuilder doesn't work with cakephp 2.0 (or 2.1)

2012-03-12 Thread Thomas

Finally got it to work... What was missing?

Did not know that I have to add "Form" and "Html" Helpers to the $helpers 
array like this:

var $helpers = array('Forms', 'Html', 'MenuBuilder.MenuBuilder');

After reading the documentation several times I finally found this small 
sentence:

"Remember to include the default Html and Form helpers"

Too bad this important piece of information was not more obvious (eg. big 
red letters :-)


Am Donnerstag, 8. März 2012 23:38:13 UTC+1 schrieb Rob:
>
> You should drop the entire MenuBuilder directory structure into the Plugin 
> directory. That means that the path for the helper class will end up being 
> app/Plugin/MenuBuilder/View/Helper/MenuBuilderHelper.php.
> Plugins do have to be loaded in your bootstrap file. See 
> http://book.cakephp.org/2.0/en/plugins.html
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Cake Bake issu under PHP 5.3.10?

2012-03-12 Thread avairet
Does anybody have problem with Cake bake under PHP 5.3.10?

I'm using Cakephp 1.3.14 on WinXP and I've no problem until installing
PHP 5.3.10.

In fact, I can't launching Cake Bake: I've got always an "PHP Cli
error"?!

I can launching Cake i18n, Cake api, etc. even Cake media init (Media
Plugin) or Cake benchmark (Debug kit), without problem. But a simple
"cake bake" fails...

I've reinstalled a PHP 5.3.8 version and everything is good. But I
must use 5.3.10 for a project, cause of secure environment...

Any idea is welcome ;)

BR

Avairet

PS : sorry for my simple English...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Do I need to load a Model if I reference it in a contain?

2012-03-12 Thread Kro
I have removed 'var $uses' from a controller and replaced it with
calls to 'loadModel()'. I'm just wondering if I need to load a model
which isn't referenced directly in a function, but is referenced in a
contain.
e.g.

$contain =
array('SurveyResponse'=>array('SurveyQuestion'),'BookingOrder'=>array('Room','Rate','AddOnPurchase'=>array('AddOn')));
 //
Association between Booking and SurveyResponse in SurveyResponse Model
$this->Booking->contain($contain);

Is it necessary to load the 'SurveyResponse' Model as it is mentioned
in the above contain statement for the Booking Model?

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Filling in a drop down box - comments on code please

2012-03-12 Thread Graham


Dear All. I would like some advice please. I am new to CakePHP and so far I 
am loving it. I am keen to do things the “right way” so I am interested in 
any comments.

 

What I describe in the following I have working. I am interested in knowing 
if I have gone about it the right or wrong way.

 

I have a table with a varchar field that I want to complete with data from 
another table – my choices table. There is no connection between the two 
tables.

 

In my controller I have the following:

 

  App::import('Model', 'Choice');

  $tmpChoice = new Choice();

 

  $titles = $tmpChoice->find('list', array(

  'fields' => array('item', 'item'),

  'conditions' => array('cat' => 'title'),

  'recursive' => 0

  ));

  $this->set(compact('titles'));

 

I have this in my view:

 

 echo $this->Form->input('title', 
array('type'=>'select','options'=>$titles));

 

Above, I needed to instantiate the Choice model class to make it available 
to my code. When I used:

 

$titles = $this->MainTable->Choice->find('list',…

 

I received an error saying that I was trying to execute a function of an 
object that isn’t a class. I resorted to my above code to resolve the error.

 

The “fields” array specifies “('item', 'item')”. This I did so that I could 
have the value and the option the same – I didn’t want to insert the id key 
into the database, I wanted the text. The “conditions” statement is present 
so that I can select the appropriate category of choices.

 

Thanks for looking at this and making any comments about the code.

 

With regards

 

Graham Jones

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: AppComponent

2012-03-12 Thread euromark
you can always use classic OOP to extend a base class (similar to the new 
BaseAuth etc)

create your BaseComponent and then extend it:

MyExampleComponent extends BaseComponent



Am Montag, 12. März 2012 11:19:08 UTC+1 schrieb Ernesto:
>
> Hi all
>
> i have an app with 4 components.
> every component has some parts wich are common (calculating sessionVar, 
> some default settings and so on)
> is there any way to have a class, like AppController is for Controllers 
> where i can define some standards for my components?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


AppComponent

2012-03-12 Thread Ernesto
Hi all

i have an app with 4 components.
every component has some parts wich are common (calculating sessionVar, 
some default settings and so on)
is there any way to have a class, like AppController is for Controllers 
where i can define some standards for my components?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php