cakephp-2.3

CakePHP - Why does Model::save cause() an INSERT instead of an UPDATE?

泪湿孤枕 提交于 2019-11-28 10:12:39
问题 I want to update database in CAKEPHP's Way this is my controller $data = array( 'KnowledgeBase' => array( 'kb_title' => $this->data['KnowledgeBase']['kb_title'], 'kb_content' => $this->data['KnowledgeBase']['kb_content'] 'kb_last_update' => date("Y-m-d G:i:s"), 'kb_segment' => $this->data['KnowledgeBase']['kb_segment'] )); $this->KnowledgeBase->id_kb = $this->data['KnowledgeBase']['id_kb']; $this->KnowledgeBase->save($data); assume I have post form is true, when I execute the program I have

CakePHP 2.x sessions behaving inconsistently between local dev and production

半城伤御伤魂 提交于 2019-11-28 02:31:19
问题 I have a CakePHP 2.x site I'm working on which performs as intended locally. Login works, session flash messages work, etc. When I push the code to my staging/prod server it's breaking. Logins no longer work, no session flash messages appear, some controller actions that should be redirecting to /user/login are displaying nothing (empty document), etc. I'm at a loss as to what the problem would be. Based on the issues I'm experiencing and some searching I've done I believe I've ruled out

Strict (2048): Declaration of EmailComponent::initialize() should be compatible with Component::initialize(Controller $controller) [duplicate]

被刻印的时光 ゝ 提交于 2019-11-28 02:21:11
This question already has an answer here: CakePHP PaginationRecallComponent, Strict (2048): Declaration of PaginationRecallComponent::initialize() 1 answer I upgraded my XAMPP version and installed PHP 5.5.9. After upgradetion I am getting this message. I googled it but not able to find clear idea to fix it. I got one link of stackoverflow , they are talking about signature of the initialize method, but didn't get exactly where I need to modify. Please guide me how to fix it. Thank you in Advance. Error: Strict (2048): Declaration of EmailComponent::initialize() should be compatible with

creating virtual fields on the fly in CakePHP

风流意气都作罢 提交于 2019-11-28 00:19:59
I wish to create virtual fields on the fly. My Order & Order Details are like... //Order Model class Order extends AppModel { public $name = 'Order'; public $actsAs = array('Containable'); public $hasMany = array( 'OrderDetail' => array( 'className' => 'OrderDetail', 'foreignKey' => 'order_id', 'dependent' => true ), ); } //OrderDetail Model class OrderDetail extends AppModel { public $name = 'OrderDetail'; public $actsAs = array('Containable'); public $belongsTo = array( 'Order' => array( 'className' => 'Order', 'foreignKey' => 'order_id', 'dependent' => true ), ); } The model relation is

creating virtual fields on the fly in CakePHP

久未见 提交于 2019-11-27 04:43:50
问题 I wish to create virtual fields on the fly. My Order & Order Details are like... //Order Model class Order extends AppModel { public $name = 'Order'; public $actsAs = array('Containable'); public $hasMany = array( 'OrderDetail' => array( 'className' => 'OrderDetail', 'foreignKey' => 'order_id', 'dependent' => true ), ); } //OrderDetail Model class OrderDetail extends AppModel { public $name = 'OrderDetail'; public $actsAs = array('Containable'); public $belongsTo = array( 'Order' => array(

Strict (2048): Declaration of EmailComponent::initialize() should be compatible with Component::initialize(Controller $controller) [duplicate]

廉价感情. 提交于 2019-11-26 23:43:06
问题 This question already has an answer here : CakePHP PaginationRecallComponent, Strict (2048): Declaration of PaginationRecallComponent::initialize() (1 answer) Closed 5 years ago . I upgraded my XAMPP version and installed PHP 5.5.9. After upgradetion I am getting this message. I googled it but not able to find clear idea to fix it. I got one link of stackoverflow , they are talking about signature of the initialize method, but didn't get exactly where I need to modify. Please guide me how to