Tuesday, April 30, 2013

Re: Help with Cake Auth - Manual Login

Okay, was able to get it working by adding the following to my beforefilter:

$this->set('user', $this->Auth->user());


On Tuesday, April 30, 2013 9:01:45 PM UTC-6, Shahruk Khan wrote:
This is the working code I have:

if($this->Auth->login($user['User']))

Using this, I was able to force log my users in via Facebook. Do a find for the user and pass the User array.

On Tuesday, April 30, 2013 5:22:18 PM UTC-4, James Lukensow wrote:
I'm running into a issue here, trying to get Cake to manually log a user in. Here is what I am trying to accomplish.

I'm using a XML-RPC to log the user in to Vbulletin from Cakephp, what I get back are some cookies, and user info. On the CakePhp Side of things, I have a Users table, which contains:

1. id
2. vbulletinid
3. username
4. avatar
5. created
6. modified

Now, when you're on the Cake side of things, and you log in, within my login() method, I grab the following, for the xml-rpc call:

$username = $this->request->data['User']['username'];
$password = $this->request->data['User']['password'];

If the response is valid, and the user is logged in remotely to vbulletin, I then insert the user into the Users table. If they're already in there, I just update the username and avatar, etc.

So, I was trying to do the following, to force the login:

$this->Auth->login($user)

Where $user contained:

Array
(
    [User] => Array
        (
            [id] => 13
            [username] => testuser
        )

)

I thought everything was working, until I turned off the Debugkit plugin. Then, it seems like my login is not working actually. With it turned off, I can't force Cake to log my current user in.

Anyone have any ideas on how to force a login?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Help with Cake Auth - Manual Login

What values are you passing inside of the $user array. I assume just a username and what else?

On Tuesday, April 30, 2013 9:01:45 PM UTC-6, Shahruk Khan wrote:
This is the working code I have:

if($this->Auth->login($user['User']))

Using this, I was able to force log my users in via Facebook. Do a find for the user and pass the User array.

On Tuesday, April 30, 2013 5:22:18 PM UTC-4, James Lukensow wrote:
I'm running into a issue here, trying to get Cake to manually log a user in. Here is what I am trying to accomplish.

I'm using a XML-RPC to log the user in to Vbulletin from Cakephp, what I get back are some cookies, and user info. On the CakePhp Side of things, I have a Users table, which contains:

1. id
2. vbulletinid
3. username
4. avatar
5. created
6. modified

Now, when you're on the Cake side of things, and you log in, within my login() method, I grab the following, for the xml-rpc call:

$username = $this->request->data['User']['username'];
$password = $this->request->data['User']['password'];

If the response is valid, and the user is logged in remotely to vbulletin, I then insert the user into the Users table. If they're already in there, I just update the username and avatar, etc.

So, I was trying to do the following, to force the login:

$this->Auth->login($user)

Where $user contained:

Array
(
    [User] => Array
        (
            [id] => 13
            [username] => testuser
        )

)

I thought everything was working, until I turned off the Debugkit plugin. Then, it seems like my login is not working actually. With it turned off, I can't force Cake to log my current user in.

Anyone have any ideas on how to force a login?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

How can I keep a user logged in?

The Miles component is not what I'm looking for. Right now, I log users in via Facebook or regular login. I want to do some logic in the AppController where once they are logged in, they don't have to keep relogging in every single day. Once you're logged in you stay logged in.

Any tips?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Help with Cake Auth - Manual Login

This is the working code I have:

if($this->Auth->login($user['User']))

Using this, I was able to force log my users in via Facebook. Do a find for the user and pass the User array.

On Tuesday, April 30, 2013 5:22:18 PM UTC-4, James Lukensow wrote:
I'm running into a issue here, trying to get Cake to manually log a user in. Here is what I am trying to accomplish.

I'm using a XML-RPC to log the user in to Vbulletin from Cakephp, what I get back are some cookies, and user info. On the CakePhp Side of things, I have a Users table, which contains:

1. id
2. vbulletinid
3. username
4. avatar
5. created
6. modified

Now, when you're on the Cake side of things, and you log in, within my login() method, I grab the following, for the xml-rpc call:

$username = $this->request->data['User']['username'];
$password = $this->request->data['User']['password'];

If the response is valid, and the user is logged in remotely to vbulletin, I then insert the user into the Users table. If they're already in there, I just update the username and avatar, etc.

So, I was trying to do the following, to force the login:

$this->Auth->login($user)

Where $user contained:

Array
(
    [User] => Array
        (
            [id] => 13
            [username] => testuser
        )

)

I thought everything was working, until I turned off the Debugkit plugin. Then, it seems like my login is not working actually. With it turned off, I can't force Cake to log my current user in.

Anyone have any ideas on how to force a login?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Carregar campo tipo tinyint(1)

Hi Anderson,

I don't speak Portuguese but Google Translator made it :P

you will see that a tinyint(1) is likely a flag, on/off.

And you are using an 'options' key in the options array.
$this->Form->input(String $fieldName, Array $options); // Parameters are the fieldName and the $options array. 

Now, if what you want is to set the initial state of the checkbox, use the 'checked' key inside the $options array.
$this->Form->input('status', array(
'checked' => false                                                            // This can be true or false, depending if you want it active or inactive respectively.
));


Regards,
Ciul

Translation:
Guys, good afternoon.

I did a CRUD client, where one of the fields of my table is of type "tinyint (1)", the field name is "status".

So when I click on the edit controller that catches my view it loads the form fields correctly, including the field of type "select" state, but the make up "status" does not load properly, I will explain what happens.

I have the following input:

$ this-> Form-> input ('status', array (
             'options' => array (true => 'Active', false => 'Inactive') // ERROR: Don't set an 'options' key inside the $options array
         ))

Is recorded in Table 1 for true and 0 for false, but when the client is as inactive (0) and I click change, it should load the status field as "Inactive", but it loads as "Active", do not know if because it is the first in the options.

Can anyone help me with this??

thank you,

Anderson

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Best way to set up this Relation

Hi Fernando,

an idea that it's up to you to try is implement a MovieParticipation Model.

Thus:
Celebrities hasMany MovieParticipation
Movies hasMany MovieParticipation

Where the MovieParticipation table might have following fields:
  • id
  • celebrity_id
  • movie_id 
  • as_actor
  • as_director
  • as_scriptwritter
Where these as_{participation} fields are just flags (on-off). Since in Hollywood there are some cases where the Director is an Actor too in his movie, this way could allow you to handle them by having more than one of these flags on.

Also, in this way, I think you won't be needing Actors, Directors and ScriptWritters Models and Controllers as separate stuff, just Celebrities.
Now that will depend on the other features and how the whole app is expected to work.

Regards,
Ciul

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

make a dynamic select box !

how can i make a dynamic select box contain the list of names of all the clients in the database ?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Carregar campo tipo tinyint(1)

Pessoal, boa tarde.

Eu fiz um CRUD de clientes, onde um dos campos da minha tabela é do tipo "tinyint(1)", o nome do campo é "status".

Então, quando eu clico no controller edit que chama a minha view ele carrega os campos do formulário corretamente, inclusive o campo do tipo "select" de estados, mas o compo "status" não carrega corretamente, vou explicar o que acontece.

Eu tenho o seguinte input:

$this->Form->input('status', array(
            'options' => array(true => 'Ativo', false => 'Inativo')
        )),

Na tabela é gravado 1 para true e 0 para false, mas quando o cliente está como inativo (0) e eu clico em alterar, ele devia carregar o campo status como "Inativo", mas ele carrega como "Ativo", não sei se porque ele é o primeiro na options.

Alguém pode me ajudar com isso???

Grato,

Anderson

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Help with Cake Auth - Manual Login

I'm running into a issue here, trying to get Cake to manually log a user in. Here is what I am trying to accomplish.

I'm using a XML-RPC to log the user in to Vbulletin from Cakephp, what I get back are some cookies, and user info. On the CakePhp Side of things, I have a Users table, which contains:

1. id
2. vbulletinid
3. username
4. avatar
5. created
6. modified

Now, when you're on the Cake side of things, and you log in, within my login() method, I grab the following, for the xml-rpc call:

$username = $this->request->data['User']['username'];
$password = $this->request->data['User']['password'];

If the response is valid, and the user is logged in remotely to vbulletin, I then insert the user into the Users table. If they're already in there, I just update the username and avatar, etc.

So, I was trying to do the following, to force the login:

$this->Auth->login($user)

Where $user contained:

Array
(
    [User] => Array
        (
            [id] => 13
            [username] => testuser
        )

)

I thought everything was working, until I turned off the Debugkit plugin. Then, it seems like my login is not working actually. With it turned off, I can't force Cake to log my current user in.

Anyone have any ideas on how to force a login?

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Layout and

Hello everyone,

I enabled the cache helper on one of my controllers and it's working perfectly with some major issue that has forced me to disable. I have in my default layout a call to include a file:

include "header.php"; it's the typical header with some static menues and a "sign in" link an there is where my problem starts, this link has the typical if() to checking for a user signed in and either show the sign in link or the user's name. I have added <!--nocache--> & <!--/nocache--> tags around the whole <div></div> element holding that code but the view will not generate the different content. 

I have read http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html several times but I don't seem to figure out if something is wrong or what I want is not possible. 

Some extra details:

1) Configuration is ok, cached views are being stored on the tmp directory and they show an incredible speed increment. 
2) I tried clearing my browser cache and restarting the webserver. 

Can someone confirm if what I'm trying to achieve is possible?

cheers!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Looking for a Freelance CakePHP Programmer

Hi All,

We are a web design/development firm in New York City, and we are looking for a freelance CakePHP programmer to build a website for a non-profit organization. Our client needs to sell tickets for events and collect registration information. We have someone who will be doing the front-end coding (Javascript, HTML and CSS) and design; we need someone to do the server-side. In terms of workload, I estimate that the coding would take no more than a month, and it would start in about a month from now. We are based in New York City but the freelancer does not have to be here (although it would be nice if you live here, just so that we can hang out sometimes). We do however need him/her to be somewhere near the Eastern Standard Time, like West coast, Central/South America, and Europe. (Beyond that, the time difference would be too hard for us to manage.) We have our own servers at MediaTemple and we use SVN. We prefer programmers on Mac.

If you are interested, please email me directly -> dyske@cycleia.com

Thank you for your attention,
Dyske Suematsu
Partner, CYCLE Interactive
http://cycle-interactive.com

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Cake 2.1 Events:

Hi again @phpMagpie,

I've just found two better ways to achieve what you wish.

#1
Override the Model "implementedEvents" method. If you check the CakePHP Model class code you see that it already implements CakeEventListener class).

/**
 * Returns a list of all events that will fire in the model during it's lifecycle.
 * You can override this function to add you own listener callbacks
 *
 * @return array
 */
public function implementedEvents() {
return array(
'Model.beforeFind' => array('callable' => 'beforeFind', 'passParams' => true),
'Model.afterFind' => array('callable' => 'afterFind', 'passParams' => true),
'Model.beforeValidate' => array('callable' => 'beforeValidate', 'passParams' => true),
'Model.afterValidate' => array('callable' => 'afterValidate'),
'Model.beforeSave' => array('callable' => 'beforeSave', 'passParams' => true),
'Model.afterSave' => array('callable' => 'afterSave', 'passParams' => true),
'Model.beforeDelete' => array('callable' => 'beforeDelete', 'passParams' => true),
'Model.afterDelete' => array('callable' => 'afterDelete'),
);
}

#2
Override the Model "getEventManager" method. If you check CakePHP Model class code you see that it also suggest you to use it to register any new listener or callbacks to the model events, or create your own events and trigger them at will.

/**
 * Returns the CakeEventManager manager instance that is handling any callbacks.
 * You can use this instance to register any new listeners or callbacks to the
 * model events, or create your own events and trigger them at will.
 *
 * @return CakeEventManager
 */
public function getEventManager() {
if (empty($this->_eventManager)) {
$this->_eventManager = new CakeEventManager();
$this->_eventManager->attach($this->Behaviors);
$this->_eventManager->attach($this);
}
return $this->_eventManager;
}


Thus use them.

In your particular case, you could override the getEventManager for creating your attaching the BlogEventListener.

Regards.

References:

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Best way to set up this Relation

Hey everybody.

I am looking for some advice here.
I got the following tables in my application: Movies and Celebrities. Celebrities can participate in movies as Actors, Directors and Script Writters.

So, while editing a movie (or adding one) I should be able in my view to select in 3 different fields the Celebrities that take role in each part.

I read that in these situations I should not use HABTM relations as it won't set the parameter that will allow me to differentiate Actors from Directors. So I would need to create a model for the relationship table and set HasMany relations instead. Does that sound correct?

Also, if I'm creating a Model for this relation, how would my Movies Controller and View be set up?

Thanks a lot in advance!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Cake 2.1 Events:

Hi @phpMagpie,

from my personal point of view, you are doing it right.

Since you were not too much confident about where to attach events to the EventManager, well, I propose two ways I think, might be cleaner that in the Controller according to your example.

Method #1:
Use CakePHP bootstrap using a Filter which uses the Global Event Manager. This way would be more likely for global events in your app.

Method #2
I think that a more properly event name would be Model.Blog.afterAdd or probably Model.Post.afterAdd instead of current one Controller.Blog.afterAdd.
And neither using the Controller beforeFilter callback to attach it.

Now, how to achieve that?
Well, since you are working with a specific part of your app for handling the event after adding a Post to your Blog (I guess). Why not using the Model beforeSave callback to attach the listener?

Those are just ideas, it's up to you to accept them or reject them :]

Regards.

References:

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Hidden fields in IE (cakePHP: 2.3.2)

It´s not a IE problem, if you see what is generated with your code, is an input type of text, and the hidden field is an input type of hidden, not an input type text with a hidden param...


Em terça-feira, 30 de abril de 2013 07h20min59s UTC-3, Mario Rico escreveu:
I'm having a problems with Internet explorer and hidden fields. it isn't hide them.

IE 10 or older
cakePHP: 2.3.2


use:
echo $this->Form->input('category', array('type' => 'text', 'value' => $category, 'hidden' => true, 'label' => false));

source generated:
<input name="data[Document][category]" id="DocumentCategory" required="" type="text" hidden="1" value="Certification"/>


can you help me?

thank you

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Hidden fields in IE (cakePHP: 2.3.2)

Perfect Jeremy

I wonder why it is happening only in IE.

Thanks you very much.

On Tuesday, 30 April 2013 11:28:31 UTC+1, Jeremy Burns wrote:
What happens when you try:

echo $this->Form->hidden('category', array('value' => $category)); 

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Apr 2013, at 11:20:59, Mario Rico <mari...@gmail.com> wrote:

I'm having a problems with Internet explorer and hidden fields. it isn't hide them.

IE 10 or older
cakePHP: 2.3.2


use:
echo $this->Form->input('category', array('type' => 'text', 'value' => $category, 'hidden' => true, 'label' => false));

source generated:
<input name="data[Document][category]" id="DocumentCategory" required="" type="text" hidden="1" value="Certification"/>


can you help me?

thank you

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Hidden fields in IE (cakePHP: 2.3.2)

What happens when you try:

echo $this->Form->hidden('category', array('value' => $category)); 

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Apr 2013, at 11:20:59, Mario Rico <mariorico@gmail.com> wrote:

I'm having a problems with Internet explorer and hidden fields. it isn't hide them.

IE 10 or older
cakePHP: 2.3.2


use:
echo $this->Form->input('category', array('type' => 'text', 'value' => $category, 'hidden' => true, 'label' => false));

source generated:
<input name="data[Document][category]" id="DocumentCategory" required="" type="text" hidden="1" value="Certification"/>


can you help me?

thank you

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hidden fields in IE (cakePHP: 2.3.2)

I'm having a problems with Internet explorer and hidden fields. it isn't hide them.

IE 10 or older
cakePHP: 2.3.2


use:
echo $this->Form->input('category', array('type' => 'text', 'value' => $category, 'hidden' => true, 'label' => false));

source generated:
<input name="data[Document][category]" id="DocumentCategory" required="" type="text" hidden="1" value="Certification"/>


can you help me?

thank you

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Problem with Pagination of search results

That's perfect! thanks again!



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Problem-with-Pagination-of-search-results-tp5714685p5714707.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Monday, April 29, 2013

Re: Problem with Pagination of search results

Just having another look at your code that is using sessions...

It looks as though when someone submits the form that contains the 'search' field, you are saving that to the session, but then checking for it's existence, reading it straight back out, and never doing the paginate.

Here is snippet of your code, modified to make better use of the session for storing the search term.  I've kept the session name the same, however, I would recommend calling it user_search, user_filter or just search, instead of users, since you're not actually storing users in the session.

public function search() { 
                // if form submitted, save search keyword to the session
                if (!empty($this -> data)) { 
                        $keyword = $this->data['User']['search']; 
                        $this->Session->write('users', $keyword); 
                }

                // if we have a search keyword, set paginate conditions
                $conditions = array('1 = 1');
                if ($this -> Session -> check('users')) { 
                    $keyword = $this -> Session -> read('users'); 
                    $conditions['or'] = array(array('User.first_name LIKE' => $keyword . '%'),array('User.last_name LIKE' => $keyword . '%'));
                } 

                // always do a paginate
                $this->paginate = array('User' => array('conditions' => $conditions, 'limit' => 5));
                $this->set('users', $this->paginate('User'));



On Tuesday, 30 April 2013 03:39:02 UTC+10, Lilit Bakunts wrote:
I only had  $this->Paginator->numbers() in view.
I'll try to make it via GET.. but after knowing how to use with sessions :)
Thanks for your reply !



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Problem-with-Pagination-of-search-results-tp5714685p5714704.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

edit form needs to be submitted two times while using security component

Hi Friends,

Can anyone  help me out with this , i have a edit form with security component ,


it needs to be submitted two times i have checked in console , in form security component hidden token METHOD IN by default PUT ,

when i click submit first time it changes to post ,then second time when i click submit form gets submitted,

please let me know how can i fix this ,its very strange to click submit two times... 


Thnaks,
Vinod

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Problem with Pagination of search results

I only had $this->Paginator->numbers() in view.
I'll try to make it via GET.. but after knowing how to use with sessions :)
Thanks for your reply !



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Problem-with-Pagination-of-search-results-tp5714685p5714704.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

subdomain cpanel error

Hi there!

Sorry for the poor english! I have a new problem after moving my site from local to the server, where i placed that in a subdomain. The problem is:

Warning: include(Cake/bootstrap.php) [function.include]: failed to open stream: No such file or directory in /home/agrarinf/public_html/demo/app/webroot/index.php on line 91

Warning: include(Cake/bootstrap.php) [function.include]: failed to open stream: No such file or directory in /home/agrarinf/public_html/demo/app/webroot/index.php on line 91

Warning: include() [function.include]: Failed opening 'Cake/bootstrap.php' for inclusion (include_path='/home/agrarinf/public_html/demo/lib:.:/usr/lib/php:/usr/local/lib/php') in/home/agrarinf/public_html/demo/app/webroot/index.php on line 91

Fatal error: CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your /cake core directory and your /vendors root directory. in /home/agrarinf/public_html/demo/app/webroot/index.php on line 100


I took the problem is the program can not include the file but i cant solve it :( Pls anyone help me! 
Thx a lot!

Attila

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Security Release - CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4

Can you tell what release this problem was introduced, I think it was 1.2RC2, right?

On Sunday, April 28, 2013 4:37:05 PM UTC-4, mark_story wrote:
If you are using CakePHP's PaginatorComponent without whitelisted sort fields you should upgrade as soon as possible to prevent
possible SQL injections.

CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4 have just been released to fix a critical issue with how pagination & PaginatorComponent handle sort criteria. When paginating without a sort column whitelist it was possible to execute arbitrary SQL by manipulating the sort conditions. In the following days we will offer a full description of the vulnerability and how it can be exploited, after some reasonable time has passed for our users to upgrade.

In addition to the security fix 2.3.4 contains fixes for the following issues:

* Support for HTTP code 505 was added.
* Router::currentRoute() returns false when there is no current route.
* Writing to file cache after clearing a group now works as expected.
* Asset URLS using fullBase are now generated correctly when not using URL re-writing.

There are no additional fixes outside the security fix in 2.2.8.

In addition to the security fix 1.3.16 contains fixes for the following issues:

* Databases is now singularized correctly.
* Saving translations with saveAll() now works better.
* Oracle listSources() no longer reads from the global table namespace.
* The cake console command now works on MacOS properly.
* Mixing query[contain] and contain() now interact properly.

In addition to the security fix 1.2.12 contains fixes for the following issues:

* umask is now set when creating cache files.
* Boundaries for multipart email messages are now generated correctly.
* Compatibility with PHP 5.4 has been improved.

We recommend all users of 1.2, 1.3, and 2.x release series upgrade as soon as possible to the new releases.

Links
------

* Download a packaged release http://github.com/cakephp/cakephp/tags
* View the changelogs http://cakephp.org/changelogs

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Paginate search results

It looks like you are making a call to the PaginatorHelper in the view, when no actual pagination has taken place. And this happens when you submit the search form.

Firstly, I would recommend not using a POST for your search form.  Use a GET instead, so that everything is on the query string, and you don't need to rely on Sessions.

I would also recommend setting up the paginator to use the query string, rather than named params, and you see why in the second.

In your search form create, specify the url option to be $this->Paginator->url().  This make sure that when you post the search, via a GET, extra settings like the sort field and direction, what page you are on, and the limit are remembered.

Also, when you specifiy $this->Paginator->sort(), also pass through $this->Paginator->url(), so that your search field is remembered when you change the sort.  You may also need to do a similar thing for $this->Paginator->numbers(), first(), prev(), last() and next() (which reminds me, I better check the code I was working on today, doing just this very thing).

By using $this->Paginator->url(), you can pass around the paginator parameters, and any extra params (like search filters), and by using GET in your form, each request is stateless, and doesn't require a session.

On Sunday, 28 April 2013 04:17:43 UTC+10, Lilit Bakunts wrote:
Hi people.
I'm new to cakephp and need your help. I have this search function in my
UsersController, so there's a problem with search result pagination. The
first page shows first five names properly, but next pages does not show
anything. I need that this session save all my users, then check and
basically read it in next pages.
so how it should be?
th error message

*Undefined index: pageCount [CORE\Cake\View\Helper\PaginatorHelper.php, line
702]*

and the
public function search() {

                if (!empty($this -> data)) {
                        $keyword = $this -> data['User']['search'];
                        $this -> Session -> write('users', $keyword);
                        
                        if ($this -> Session -> check('users')) {
                                $keyword = $this -> Session -> read('users');

                        } elseif (isset($keyword, $this -> data['User']['search'])) {
                                $this -> paginate = array('conditions' => array('OR' =>
array("User.first_name LIKE" => "$keyword%", "User.last_name LIKE" =>
"$keyword%")), 'limit' => 5);
                                $this -> set('users', $this -> paginate('User'));

                        }
                }

pls helpp
Thanks in advance :)



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Paginate-search-results-tp5714685.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

You'd be better off doing it from the Model, and would only have to do the save once.  From the controller, and using saveField(), you now have two saves happening.. one for your original data, and the other for the modified_by / created_by fields.

Also, if you put it in the model, then the logic goes where ever the model goes, especially if it gets refactored into a plugin.  In the controller, the user would need remember to add this in everytime an application wanted to use that plugin.

The original poster might be looking at the app controller, so he doesn't have to update 23 models with essentially the same code.  I would recommend looking at Behaviors.  Write a behaviour to set those fields on the beforeSave, then attach that behaviour to all the models that require it.

On Monday, 29 April 2013 08:54:57 UTC+10, advantage+ wrote:

Why not from the controller? Sure from model makes more sense but you can still do it from the controller

 

$this->alias->saveField()

 

 

 

From: cake...@googlegroups.com [mailto:cake...@googlegroups.com] On Behalf Of Chetan Varshney
Sent: Sunday, April 28, 2013 3:02 PM
To: cake...@googlegroups.com
Subject: Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

 

Please ignore previous reply-
Now
You cannot do save these fields from app controller rather than you can do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman <zahidc...@yahoo.com> wrote:

Hi Experts,

I have almost 23 table in which i have added created_by and modified_by field. Is there any way to save these two field from app_controller.php. I mean i dont want to add those field in eash method where i am saving. I want to do it from app_controller.php. Please let me know it is possible or not.

 

Thanks

Zahid

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 




--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com.
To post to this group, send email to cake...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Any cake 2.x Ajax examples?

Hi

Most of the actual ajax is client side.  So lets assume you are using jQuery, and are familiar with how that works.

With CakePHP, the convention is to use file extension based routing to recognise XML or JSON requests.  For this, define Router::parseExtensions() in your router.php, as seen at http://book.cakephp.org/2.0/en/development/routing.html#file-extensions and http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#ajax-pagination.

I'll also want to enable the RequestHandler component, to recognise an AJAX request, as seen at http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#ajax-pagination.

If you're doing XML or JSON results for your AJAX calls, be sure to append .xml or .json to your requests.  You can also use the _serialize view property to help set up an XML or JSON response, without having to define an actual view. http://book.cakephp.org/2.0/en/views/json-and-xml-views.html

For HTML responses, just be sure to define an ajax.ctp layout that just outputs the contents.

If you're using AJAX with jQuery Mobile, then ignore all of that and just do regular HTML pages. JQM will extract the data it needs from the replies, and populate the pages accordingly.

On Monday, 29 April 2013 21:01:26 UTC+10, Yen Hua Chuah wrote:
Hi
Is there any documents on how to use Ajax in Cake 2.x?
I have been trying to read the cake user manual but it only shows methods and i cant really figure out how to use it.

please help

chris

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Paginate component fetches all data not paged data

The code didn't quite come through to the Google Group, but looking at the original post...

class MyControllers extends AppController  {  public $components = array('Paginator');    public function index()  {  $this->paginate['MyModel'] = array('limit'=>5);  print_r($this->paginate('MyModel'));  }  }

Don't initialize Paginator in the $components section.  Just do

class MyControllers extends AppController  {    public function index()  {
$this->paginate = array('MyModel' => array('limit' => 5));
$this->set('data', $this->paginate('MyModel'));  }  }

The reason is, the $this->paginate settings only get set once, when the Paginate component is loaded, and this will happen automatically when you first call $this->paginate().  If you preload the Paginate component via $components, then you need to also set all your settings at that time, or pass them through with the $this->paginate() call.

Regards
Reuben Helms

On Sunday, 28 April 2013 17:06:03 UTC+10, Cyletech wrote:
Hello all,

I have a model and i want to paginate its data. all i do is, creating a
model, something like this,

and include Paginator component in my controller and use it, something like
this,


And I have a table with "my_controllers" name and it has 10 records. if
everything was fine, the paginator component must give me 5 records for page
one and 5 records for page 2. but it gives me 10 records without any paging.

What is the problem? :(


Thank you



--
View this message in context: http://cakephp.1045679.n5.nabble.com/Paginate-component-fetches-all-data-not-paged-data-tp5714688.html
Sent from the CakePHP mailing list archive at Nabble.com.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Any cake 2.x Ajax examples?

Hi
Is there any documents on how to use Ajax in Cake 2.x?
I have been trying to read the cake user manual but it only shows methods and i cant really figure out how to use it.

please help

chris

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sunday, April 28, 2013

RE: Is it possible to add any date for saving in beforeSave method in app_controller.php

Why not from the controller? Sure from model makes more sense but you can still do it from the controller

 

$this->alias->saveField()

 

 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf Of Chetan Varshney
Sent: Sunday, April 28, 2013 3:02 PM
To: cake-php@googlegroups.com
Subject: Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

 

Please ignore previous reply-
Now
You cannot do save these fields from app controller rather than you can do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman <zahidcuetcse@yahoo.com> wrote:

Hi Experts,

I have almost 23 table in which i have added created_by and modified_by field. Is there any way to save these two field from app_controller.php. I mean i dont want to add those field in eash method where i am saving. I want to do it from app_controller.php. Please let me know it is possible or not.

 

Thanks

Zahid

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 




--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Security Release - CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4

If you are using CakePHP's PaginatorComponent without whitelisted sort fields you should upgrade as soon as possible to prevent
possible SQL injections.

CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4 have just been released to fix a critical issue with how pagination & PaginatorComponent handle sort criteria. When paginating without a sort column whitelist it was possible to execute arbitrary SQL by manipulating the sort conditions. In the following days we will offer a full description of the vulnerability and how it can be exploited, after some reasonable time has passed for our users to upgrade.

In addition to the security fix 2.3.4 contains fixes for the following issues:

* Support for HTTP code 505 was added.
* Router::currentRoute() returns false when there is no current route.
* Writing to file cache after clearing a group now works as expected.
* Asset URLS using fullBase are now generated correctly when not using URL re-writing.

There are no additional fixes outside the security fix in 2.2.8.

In addition to the security fix 1.3.16 contains fixes for the following issues:

* Databases is now singularized correctly.
* Saving translations with saveAll() now works better.
* Oracle listSources() no longer reads from the global table namespace.
* The cake console command now works on MacOS properly.
* Mixing query[contain] and contain() now interact properly.

In addition to the security fix 1.2.12 contains fixes for the following issues:

* umask is now set when creating cache files.
* Boundaries for multipart email messages are now generated correctly.
* Compatibility with PHP 5.4 has been improved.

We recommend all users of 1.2, 1.3, and 2.x release series upgrade as soon as possible to the new releases.

Links
------

* Download a packaged release http://github.com/cakephp/cakephp/tags
* View the changelogs http://cakephp.org/changelogs

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

Please ignore previous reply-
Now
You cannot do save these fields from app controller rather than you can do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman <zahidcuetcse@yahoo.com> wrote:
Hi Experts,
I have almost 23 table in which i have added created_by and modified_by field. Is there any way to save these two field from app_controller.php. I mean i dont want to add those field in eash method where i am saving. I want to do it from app_controller.php. Please let me know it is possible or not.

Thanks
Zahid

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

You can do save these fields from app controller rather than you can do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman <zahidcuetcse@yahoo.com> wrote:
Hi Experts,
I have almost 23 table in which i have added created_by and modified_by field. Is there any way to save these two field from app_controller.php. I mean i dont want to add those field in eash method where i am saving. I want to do it from app_controller.php. Please let me know it is possible or not.

Thanks
Zahid

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Chetan Varshney
Ektanjali Softwares Pvt Ltd

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Is it possible to add any date for saving in beforeSave method in app_controller.php

Hi Experts,
I have almost 23 table in which i have added created_by and modified_by field. Is there any way to save these two field from app_controller.php. I mean i dont want to add those field in eash method where i am saving. I want to do it from app_controller.php. Please let me know it is possible or not.

Thanks
Zahid

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.