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@
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 ->
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
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
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
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
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
> ... 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
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
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,
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
--
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
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
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
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
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
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 <
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
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
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!
--~--~-
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
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
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
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
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
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 <
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
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
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
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
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
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
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
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!
--~--~-~--~~~-
48 matches
Mail list logo