cakephp-3.0

Cake 3.x How to setup a queue technology for jobs and news feeds?

江枫思渺然 提交于 2020-07-19 18:32:44
问题 I am using Cake 3.x I need to have the following things set up. A job queue to queue jobs that require long processing in the background A feed (like Facebook Feed) that informs various users of what's happening within the app This is what I have in terms of requirements: Job Queue This needs to be persistent and reliable. Meaning to say if the server suddenly rebooted, any jobs queued but not yet executed will still be there waiting to be processed upon reboot. News Feed / Activity Stream

PHP Fatal error: You must enable the intl extension to use CakePHP. in C:\xampp\htdocs\Cakecrud\config\requirements.php on line 31

主宰稳场 提交于 2020-07-16 09:40:25
问题 I have enabled both in php.ini extension= intl extension= php_intl.dll Still the error is same when I run the command on cmd Cake bake all students 回答1: It sounds like you might have added the intl exension to the wrong php.ini file. It needs to be added to the web php.ini file, not cli. To check what extensions are loaded for the web, write phpinfo();exit; in a PHP file then hit hit. To see whats loaded in PHP cli (where you may have added it by mistake), run php -m at a terminal. 来源: https:

How to manipulate the child items of the tree menu in cakephp 3?

自古美人都是妖i 提交于 2020-06-23 14:13:32
问题 I'm having doubts about manipulating the child menu items to improve the display style. I am currently generating according to documentation: function index() { $list = $this->Categorias->find('threaded')->toArray(); $this->set('list', $list); } $renderItems = function($items) use (&$renderItems) { echo '<ul>'; foreach ($items as $item) { echo '<li>'; echo h($item->name); if ($item->children) { $renderItems($item->children); // < recursion } echo '</li>'; } echo '</ul>'; }; $renderItems($list

cakephp 3 original data in afterSave

回眸只為那壹抹淺笑 提交于 2020-02-15 07:58:28
问题 Is there any way to access original data in afterSave? I would like to log the changes on important data. With $entity->isNew() I could check if it was an insert or an update, but how can I get what changed? 回答1: You can access the original values via Entity::getOriginal() or Entity::extractOriginal() . If you want to get all changed fields, combine the latter one with Entity::visibleProperties() , something like: debug($entity->extractOriginal($entity->visibleProperties())); This should

How to prevent CakePHP 3.0 from extending session timeout with ajax requests?

僤鯓⒐⒋嵵緔 提交于 2020-02-08 02:28:09
问题 How can I prevent CakePHP 3.x from extending my users session when background ajax calls are made to the server? I am using jquery's $.ajax() as well. I have a setInterval running once a minute to get some user notifications. My application is an EHR and I need to maintain strict session timeout. My get notifications Javascript basically just made my sessions unlimited because the ajax calls are extending the sessions. I thought a saw something in the CakePHP book about this a few weeks ago

inserting only in two columns of database using cakephp

烈酒焚心 提交于 2020-02-06 07:29:26
问题 I have about 30 40 columns but only inserting in 2 columns to practice. Right now this is how i am inserting into database. UsersTable.php public function createUser($data) { $usersTable = TableRegistry::get('users'); $user = $usersTable->newEntity(); $user->first_name = $data['first_name']; $user->first_name = $data['first_name']; $usersTable->save($user); } and in the controller UsersController.php function signUp() { if($this->request->is('post')){ $data['first_name']='test first name';

inserting only in two columns of database using cakephp

寵の児 提交于 2020-02-06 07:28:50
问题 I have about 30 40 columns but only inserting in 2 columns to practice. Right now this is how i am inserting into database. UsersTable.php public function createUser($data) { $usersTable = TableRegistry::get('users'); $user = $usersTable->newEntity(); $user->first_name = $data['first_name']; $user->first_name = $data['first_name']; $usersTable->save($user); } and in the controller UsersController.php function signUp() { if($this->request->is('post')){ $data['first_name']='test first name';

cakephp flash error at Undefined variable: _SESSION [CORE/src/Network/Session.php, line 440]

三世轮回 提交于 2020-02-05 14:00:09
问题 I am following Article example from internet. Here is my Article Controller namespace App\Controller; class ArticlesController extends AppController { public function initialize() { parent::initialize(); $this->loadComponent('Flash'); // Include the FlashComponent } public function index() { $articles = $this->Articles->find('all'); $this->set(compact('articles')); } public function view($id) { $article = $this->Articles->get($id); $this->set(compact('article')); } public function add() {

cakephp error. Connection to database …not …: Access denied for user 'my_app'@'localhost' (using password: YES)

旧街凉风 提交于 2020-02-02 07:01:47
问题 I am trying to start CakePHP. I made bookmarker and tested by command bin\cake server . It showed one error as connection to database could not be established: SQLSTATE[HY000] [1045] Access denied for user 'my_app'@'localhost' (using password: YES). I read the config/app.default.php file. It says there is a database my_app and another database test_myapp with some users. I can not find these databases in phymyadmin in xampp. Am I supposed to create the named databases and users manually? I

cakephp-3.0 novice, \vendor\autoload.php

扶醉桌前 提交于 2020-01-26 02:05:48
问题 I am a cakePHP novice and am attempting to learn by examination of a working model. So far I have downloaded two cakePHP 3 examples. Both were missing a \vendor\autoload.php component. Can anyone point me to a cakePHP 3 example that works "out of the box" without any additional setup required for the novice user ? 回答1: For XAMPP needed changes in php.ini uncomment extension=php_intl.dll 来源: https://stackoverflow.com/questions/27735864/cakephp-3-0-novice-vendor-autoload-php