cakephp

Cakephp 3 - belongsToMany with _joinData

走远了吗. 提交于 2020-01-05 08:04:15
问题 I try to realize a bolongsToMany association with additional data in the join table. The join table has columns for the foreign keys and an additional column 'context' articlesController: $article = $this->Articles->patchEntity($article, $this->request->getData()); debug($article);die; and in a Plugin-Behavior: public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) { $data['Categories.Categories'] = ['id' => '1', '_joinData' => ['context' => 'Tag']]; debug($data)

POST data from knockout.js to CakePHP controller

。_饼干妹妹 提交于 2020-01-05 08:00:12
问题 I'm posting data from a knockout.js page to a controller in cakephp and it says the data was successfully posted, however, my controller doesn't seem to be responding and I don't get an alert back...not even a null response. I even checked the network tab in chrome and it shows the correct data being POSTED Here's the data being posted from my knockout viewmodel file var JSON_order = JSON.stringify({"orderInfo":[{"itemNumber":"1","quantity":"1","price":1.00,"productName":"test"}]}); $.post("

Menu Component CakePHP markstory

家住魔仙堡 提交于 2020-01-05 07:24:00
问题 I've edited the CakePHP Menu Component made by Mark Story to make it compatible with CakePHP 2.2.3. https://github.com/markstory/cakephp_menu_component The problem is that I still get an error that I can't figure out how to get rid of: http://imm.io/MK9J http://imm.io/MK9W http://imm.io/MKa7 Here is the modified code: <?php /** * Menu Component * * Uses ACL to generate Menus. * * Copyright 2008, Mark Story. * * Licensed under The MIT License * Redistributions of files must retain the above

Menu Component CakePHP markstory

人走茶凉 提交于 2020-01-05 07:23:19
问题 I've edited the CakePHP Menu Component made by Mark Story to make it compatible with CakePHP 2.2.3. https://github.com/markstory/cakephp_menu_component The problem is that I still get an error that I can't figure out how to get rid of: http://imm.io/MK9J http://imm.io/MK9W http://imm.io/MKa7 Here is the modified code: <?php /** * Menu Component * * Uses ACL to generate Menus. * * Copyright 2008, Mark Story. * * Licensed under The MIT License * Redistributions of files must retain the above

CakePhp and user permissions

こ雲淡風輕ζ 提交于 2020-01-05 07:16:06
问题 I need a system that will allow users to modify data that is related to them. Like a shopping center, with several stores and a shared catalog. I want the stores to be able to edit and add items, from and in, the global pool. but i want to limit the access of a store to its own items. how it is done with acl & auth (the concept of course)? 回答1: I've seen this question a few times. From the cake's doc it says: Access control lists, or ACL, handle two main things: things that want stuff, and

CakePhp and user permissions

烂漫一生 提交于 2020-01-05 07:15:23
问题 I need a system that will allow users to modify data that is related to them. Like a shopping center, with several stores and a shared catalog. I want the stores to be able to edit and add items, from and in, the global pool. but i want to limit the access of a store to its own items. how it is done with acl & auth (the concept of course)? 回答1: I've seen this question a few times. From the cake's doc it says: Access control lists, or ACL, handle two main things: things that want stuff, and

Cakephp JsHelper add/remove Class

二次信任 提交于 2020-01-05 07:12:35
问题 this is a simple question, but one that I have not been able to find an answer to online, or here on stackoverflow. How do I attach another function to a Js event call. This is what I have and should give some context: $this->Js->get('#all-matches'); $this->Js->event( 'click', $this->Js->request( array('action' => 'findMatches', 'all'), array('async' => true, 'update' => '#matches', 'success' => $this->Js->each('$(#event-matches).addClass("active");')) I essentially want to change a classname

dashboard timeline

让人想犯罪 __ 提交于 2020-01-05 06:39:23
问题 I'm trying to implement a dashboard similar to facebook in cakephp (getting posts and post them to timeline and while you press see more it keeps retrieving posts from previous offsets) , but im still confused about the logic and tools , should i use the cakephp pagination class in my implementations. $this->paginate(); it somehow should be called through ajax accourding to some performance wise Any helps or suggestions where to start from ? Thanks All 回答1: Don't use paginate If you paginate

dashboard timeline

做~自己de王妃 提交于 2020-01-05 06:39:11
问题 I'm trying to implement a dashboard similar to facebook in cakephp (getting posts and post them to timeline and while you press see more it keeps retrieving posts from previous offsets) , but im still confused about the logic and tools , should i use the cakephp pagination class in my implementations. $this->paginate(); it somehow should be called through ajax accourding to some performance wise Any helps or suggestions where to start from ? Thanks All 回答1: Don't use paginate If you paginate

Guidance trying to make skinny controllers & fat models in CakePHP

 ̄綄美尐妖づ 提交于 2020-01-05 05:25:28
问题 I'm new to Cake, and to MVC's in general. I want to establish good habits from the get go. Among the good habits are keeping controllers lean, and making the models fat. But it's a bit of a moving target for a noob like me. If I need to pass info from one model to another, do I just dump all that into the controller? Try to make it work in a model? Here's an action that is a prime example of the kind of confusion I'm trying to sort out. Everything seems like it should be in the controller,