Re: simple question about CakePHP syntax

2010-03-01 Thread sebb86
WebbedIT, Cristian, majna Thanks a lot! :-) 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 subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@

Re: simple question about CakePHP syntax

2010-02-13 Thread Cristian Cassina
And the big difference is that single quote can't work with variables. For example: $name = 'Cristian'; $string = 'Hi, my name is $name'; echo $string; will output -> Hi, my name is $name If you had: $name = 'Cristian'; $string = "Hi, my name is $name"; the echo $string; output would be ->

Re: simple question about CakePHP syntax

2010-02-13 Thread WebbedIT
This is not a CakePHP question, it is a {HP question. Your two strings are identical, the only difference is your are surrounding them in double quotes the first time and single the second, in neither case are the quotes part of the string. Nice little explanation here: http://v1.jeroenmulder.com

Re: simple question about CakePHP syntax

2010-02-12 Thread majna
http://hr.php.net/manual/en/language.types.string.php On Feb 12, 12:50 pm, sebb86 wrote: > Hello, > > i have a question about some signs. Is the use of this   "sample" > always equal to this   'sample'  ? > > Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with

simple question about CakePHP syntax

2010-02-12 Thread sebb86
Hello, i have a question about some signs. Is the use of this "sample" always equal to this 'sample' ? Thanks! 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 subscribed to the Googl

Re: Simple question : model file of a Join Table ?

2009-10-30 Thread John Andersen
Please provide the names of the models and the name of the join model :) Enjoy, John On Oct 30, 12:15 pm, Xanax wrote: > Hello, > > I need to configure the model of a join table. > > Actually, like in my others models, i just need to add this thing : > > var $sequence = 'MY_SEQUENCE'; > > I t

Simple question : model file of a Join Table ?

2009-10-30 Thread Xanax
Hello, I need to configure the model of a join table. Actually, like in my others models, i just need to add this thing : var $sequence = 'MY_SEQUENCE'; I tried to create a model file with the name of the table (singular, whithout the 's') but it doesn't seems to work or perhaps i missed somet

Re: Simple question from a newbie seeking help from the gods

2009-10-19 Thread WebbedIT
> ... and by answering I am not implying I am a God of any kind ;) More a demi-god :P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To

Re: Simple question from a newbie seeking help from the gods

2009-10-19 Thread Martin Westin
No, you still need a controller action... but that action does not need to do more than call the model in this case... well, and format response data for the view and things like that. The point was that you mentioned calling one controller from another... that was the main reason behind pushing t

Re: Simple question from a newbie seeking help from the gods

2009-10-18 Thread Will Poillion
Thanks Martin! So i can put the method in the model class, but how would I call it within a view? This is the link I have that calls the ingredients function to remove it from the group. If I put the method in the model, I can't call it directly like I'm doing below can I? Right now this works,

Re: Simple question from a newbie seeking help from the gods

2009-10-17 Thread Martin Westin
First the quickfix... hopefully. This will try to save a PHP-null value. $this->data['ingredient_group_id'] = null; Instead try to save an SQL-null value. $this->data['ingredient_group_id'] = 'null'; Or even just a zero if the above doesn't work. $this->data['ingredient_group_id'] = '0'; Now

Simple question from a newbie seeking help from the gods

2009-10-17 Thread Will Poillion
Just trying to update a single field within a function called from its associated model: I'm calling 'removeFromGroup' in Ingredients controller from my IngredientGroups controller. I basically want to remove the ingredient from the group, so set the ingredient_group_id to null. functio

(Hopefully) Simple question about AJAX and RequestHandler

2009-09-08 Thread BrendonKoz
I'm a little unfamiliar in how CakePHP interacts with AJAX, so please forgive me if I've missed some critical points. I've tried setting some beforeFilter settings in my AppController using RequestHandler, as follows: if($this->RequestHandler->isAjax()){ //set debug to 0 for this to alwa

Re: Simple question !

2009-09-04 Thread brian
it possible to create a "beforesave" method for all the models ? >> I mean in a file like app_controller which controll all the controllers >> > >> >> > > -- > View this message in context: > http://www.nabble.com/Simple-question-%2

Re: Simple question !

2009-09-04 Thread mig_akira
which controll all the controllers > > > > -- View this message in context: http://www.nabble.com/Simple-question-%21-tp25295075p25299320.html Sent from the CakePHP mailing list archive at Nabble.com. --~--~-~--~~~---~--~~ You received this message

Re: Simple question !

2009-09-04 Thread brian
On Fri, Sep 4, 2009 at 10:14 AM, Marcelo Andrade wrote: > > On Fri, Sep 4, 2009 at 11:09 AM, Xanax wrote: >> >> Is it possible to create a "beforesave" method for all the models ? >> I mean in a file like app_controller which controll all the controllers > > Yes.  You can create an app_model.php w

Re: Simple question !

2009-09-04 Thread Marcelo Andrade
On Fri, Sep 4, 2009 at 11:09 AM, Xanax wrote: > > Is it possible to create a "beforesave" method for all the models ? > I mean in a file like app_controller which controll all the controllers Yes. You can create an app_model.php with an AppModel class extending Model in you /app folder and overw

Simple question !

2009-09-04 Thread Xanax
Is it possible to create a "beforesave" method for all the models ? I mean in a file like app_controller which controll all the controllers --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to t

Re: Simple Question

2008-10-03 Thread ORCC
When you post a form, the selected value of a select list is in the data array as any other form field. > Hello all, how do I get the selected value from a select drop down > box. Basically I want to redirect based on the returned value however > I can not figure out how to get the selected va

Re: Simple Question

2008-10-03 Thread grigri
View: $options = array( '/things/view/%id' => 'View this thing', '/things/index' => 'Go back to the index' ); echo $form->input('WhatToDo.next', array('options' => $options, 'label' => 'What do you want to do next?')); Controller: // ... if ($this->Thing->save($this->data)) { $this->Sessi

Simple Question

2008-10-03 Thread MDB
Hello all, how do I get the selected value from a select drop down box. Basically I want to redirect based on the returned value however I can not figure out how to get the selected value? --~--~-~--~~~---~--~~ You received this message because you are subscribed t

Re: Simple question about Auth Component

2008-09-29 Thread Jérémy
thank you, it works. On Sep 29, 6:47 pm, Daniel Hofstetter <[EMAIL PROTECTED]> wrote: > Hi Jérémy, > > > I am very new with CakePHP and I am trying to set up an authentication > > system using the Auth component provided. > > > How can I show the logged user's name on a view ? Let's say the user

Re: Simple question about Auth Component

2008-09-29 Thread Daniel Hofstetter
Hi Jérémy, > I am very new with CakePHP and I am trying to set up an authentication > system using the Auth component provided. > > How can I show the logged user's name on a view ? Let's say the user > John logged in successfully, I would like to put something like > "Logout [John]" in the defau

Simple question about Auth Component

2008-09-29 Thread Jérémy
Hi, I am very new with CakePHP and I am trying to set up an authentication system using the Auth component provided. How can I show the logged user's name on a view ? Let's say the user John logged in successfully, I would like to put something like "Logout [John]" in the default layout. How can

Re: Probably a simple question on table relationships

2008-02-25 Thread Vitved
Thanks for the pr(); tip. Made me get a grip on the whole relationship thing. My dogsizes were actually hasMany and my races were belongsTo, not the other way around as I started out. I think I get the concept now. Thanks for the nudge! Also, some really nice association info in the cookbook. --

Re: Probably a simple question on table relationships

2008-02-24 Thread Dardo Sordi Bogado
Try a pr(); of the data fetched from db, also have a look at : http://manual.cakephp.org (specially the blog tutorial) http://book.cakephp.org On 2/24/08, Vitved <[EMAIL PROTECTED]> wrote: > > Hi everyone > > I'm doing a website for a friend, and wanted to try out cakephp, but > i've ended up

Probably a simple question on table relationships

2008-02-24 Thread Vitved
Hi everyone I'm doing a website for a friend, and wanted to try out cakephp, but i've ended up in a dead-end. I have a table containing dog-races. Some of the characteristics of a given race is referred to another table e.g. size. I've figured out how to grab the data in the "size" table and use

Re: Newbie...really simple question

2007-11-13 Thread Chris Hartjes
On Nov 13, 2007 12:57 PM, butangphp <[EMAIL PROTECTED]> wrote: > > Well what I'm trying to do is forget about this table/database all > together...it was a simple example I was trying to do in order to > familiarize myself with cakephp, but I have since deleted all files > related to "Post" (the c

Re: Newbie...really simple question

2007-11-13 Thread Samuel DeVore
It's possible that there are somethings in your apps tmp folder that might be causing this make sure that tmp/caches/models tmp/caches/views and tmp/cache/persistent are empty and look to make sure that you don't have something in views/pages/ and you should be close to restarting. My guess i

Re: Newbie...really simple question

2007-11-13 Thread butangphp
Well what I'm trying to do is forget about this table/database all together...it was a simple example I was trying to do in order to familiarize myself with cakephp, but I have since deleted all files related to "Post" (the controller, model, views, sql table, etc.) However when I try and load loc

Re: Newbie...really simple question

2007-11-13 Thread Samuel DeVore
and that you have permission to access that table with the db user you have set up in the database.php. Just because you can access a database doesn't always mean you have access to the tables. Sam D On 11/13/07, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > On Nov 13, 2007 11:17 AM, butangphp <

Re: Newbie...really simple question

2007-11-13 Thread Chris Hartjes
On Nov 13, 2007 11:17 AM, butangphp <[EMAIL PROTECTED]> wrote: > > I'm trying to create a new Cakephp application, however when I load up > "localhost/cake" it gives me the message > > "Missing Database Table > > No Database table for model Post (expected " posts"), create it > first." Posts is a

Newbie...really simple question

2007-11-13 Thread butangphp
I'm trying to create a new Cakephp application, however when I load up "localhost/cake" it gives me the message "Missing Database Table No Database table for model Post (expected " posts"), create it first." Posts is another application I previously made but deleted, and now I cannot get Cake t

Simple Question - Return only entries for which associated data exists

2007-09-08 Thread squidliberty
I am using hasMany to associate posts with members. How can I craft my findAll query so that it returns only members for which posts exist (ie. members who have made one or more posts)? It seems inefficient to return every member and then throw out a large amount of the data. Thanks! --~--~-

Re: Simple question about $this->set

2006-09-12 Thread Bert Van den Brande
That's exactly what I ended up doing actually :) On 9/13/06, John Zimmerman <[EMAIL PROTECTED]> wrote: > Depending on your situation it might make sense to make the variable in > question a class variable of your controller. > > Your reusable methods could then check and set the variable as neces

Re: Simple question about $this->set

2006-09-12 Thread John Zimmerman
Depending on your situation it might make sense to make the variable in question a class variable of your controller.Your reusable methods could then check and set the variable as necessary.  Then before your view is rendered (either before you action returns or in a beforeRender method) you would

Re: Simple question about $this->set

2006-09-11 Thread Bert Van den Brande
Ok tnx for the explanation :) Reason I searched for that function was that I had split some controller logic into a couple of reusable methods, and at a certain point I needed to now the decision of method X inside method Y. Of course there were plenty other solutions, but looking for a way to r

Re: Simple question about $this->set

2006-09-11 Thread nate
Controller::_viewVars is treated as a protected object property. Accessing proctected properties within a class or child of the class is perfectly legal, and I'm not a big fan of adding extra pointless getters and setters. The only reason there's a set( ) method for it is because it provides actu

Re: Simple question about $this->set

2006-09-11 Thread Larry E. Masters aka PhpNut
Bert,Logical reason is it is not awkward but correct to use the view var that was set in the controller, they are not even variables until the view "gets" them. If you need to check that your code set them, then the logical place to check is in the var itself, or like I said, since they are output

Re: Simple question about $this->set

2006-09-11 Thread Bert Van den Brande
But why provide an 'awkward' alternative to retrieve a template var you set on a controller , but not a simple get('xxx') function ? I must admit I also searched for this function instinctively a few times ... You're probably gonna smack me with a very logical reason now ey ;) On 9/11/06, nate <

Re: Simple question about $this->set

2006-09-11 Thread nate
Eeeh, it's too early in the morning... Yeah, my mistake, Nut is correct on this one. You can access any view vars you set as $this->_viewVars[$varName] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" gr

Re: Simple question about $this->set

2006-09-11 Thread Larry E. Masters aka PhpNut
On 9/11/06, nate <[EMAIL PROTECTED]> wrote: Okay fine ;-)It's on my to-do list for Cake 1.2.This is not on any todo list, this will not be added. If you need to debug a var that is set for the view, do it in the view where the code should be tested anyway since it is view output, or debug() like Fe

Re: Simple question about $this->set

2006-09-11 Thread nate
Okay fine ;-) It's on my to-do list for Cake 1.2. --~--~-~--~~~---~--~~ 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, sen

Re: Simple question about $this->set

2006-09-11 Thread Felix Geisendörfer
You can do debug($this->_viewVars); I think. -- http://www.thinkingphp.org http://www.fg-webdesign.de Mark Somerville schrieb: NickCarlson wrote: If I do the following in my controller: $this->set('myVar', 2006); How would I access the value of myVar fr

Re: Simple question about $this->set

2006-09-11 Thread Mark Somerville
NickCarlson wrote: > If I do the following in my controller: > > $this->set('myVar', 2006); > > How would I access the value of myVar from within my controller? > > For example, for debugging purposes, I just want to write the following > code within my controller, > > echo $myVar; It is very an

Re: Simple question about $this->set

2006-09-08 Thread Vanchuck
Use the standard way of setting a variable in a PHP Class, if you want to say, set a variable in one method of a class and retrieve it in another. Class SomethingController extends AppController{ function a(){ $this->myVar = "whee"; $this->b(); } function b(){ e

Re: Simple question about $this->set

2006-09-08 Thread nate
The simple answer is you don't. Set()'ing a variable in the controller doesn't give you access to it in other parts of the controller, but it will show up as $myVar in the view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Simple question about $this->set

2006-09-08 Thread NickCarlson
If I do the following in my controller: $this->set('myVar', 2006); How would I access the value of myVar from within my controller? For example, for debugging purposes, I just want to write the following code within my controller, echo $myVar; Thanks! --~--~-~--~~~-