CakePHP - Set viewVar from within EventListener

I have the following event listener but want to set a viewVar from it and having some issues figuring out how. If I can't or shouldn't, what would be the best way when I need $products available to the View? File is ./Products/Lib/Event/Products.php...
more »

2017-03-23 21:03 (1) Answers

Trigger event every X seconds in Cakephp3

I'm currently developing a system in Cakephp 3.4 which needs to check for connectivity with another machine every X seconds by sending a 'ping'. I've read the cookbook section about Events in the docs but I couldn't find any Events that trigger the...
more »

2017-03-23 20:03 (1) Answers

CakePHP 3 - Uploading multiple images

I'm trying to upload multiple images but for some reason my clientlogo won't get saved to the database, It gets saved on the folder path. How can i fix this? image - is the main image. subimages - are multiple images. clientlogo - Is another imag...
more »

2017-03-22 19:03 (0) Answers

selenium testing in cakephp with phpunit

I want to learn about ui testing with selenium in phpunit. I had phpunit installed on my cakephp project, and it was running perfectly. Then I decided to install selenium following the steps described in
more »

2017-03-22 15:03 (1) Answers

CakePHP 3.X Multiple Model association

Currently I have 'posts' and 'users' models associated to an 'attachments' model, everything works perfectly execpt for the fact that I need to put a hidden input in every form telling CakePHP which model I'm going to use, just like the code below: ...
more »

2017-03-22 14:03 (1) Answers

CakePHP find group by isn't in the generated query

We have an rather comprehensive find, see code below, with a group by part. For some reason the group part isn't working, it isn't even in the generated query. Because of this, we get double results in our find (why we wanted to use the group by func...
more »

2017-03-22 14:03 (0) Answers

Cakephp2 add controller

i have a following function to define a add function , but i want to modify it more i want 1 more image to be saved at the same time which belong to another controller and another function in this add function like uploading 2 images from same add fu...
more »

2017-03-22 13:03 (0) Answers

CakePHP Locale not updating

I have an issue with locale cakephp translations. I had to update some texts, which are not showing up on my page. Previously added texts are being displayed correctly. I tried deleting all cache folders (models, views, persistent). I have also tried...
more »

2017-03-22 11:03 (1) Answers

Php Cake 2.0 Authenticate with 2 model

I have 2 tables, 1 employee, 1 admin, my login page or view is in the admin folder. My logic is if the user is not an admin, it will check if it is an employee. I am already done with the admin part but I cant authenticate from the employee side. H...
more »

2017-03-22 08:03 (0) Answers

rendering view on ajax response in cakephp 3

I'm working in CakePHP 3.4 I'm making an Ajax request to controller for fetching some data from database and response it back to the view. Since, the data returned is a set of data which can be from 1 row to 100 rows. I want to make a separate view ...
more »

2017-03-21 17:03 (1) Answers

CakePHP 3 Edit Upload

I was following this guide to do uploads on CakePHP 3. Using that guide, I select a file, and when I click upload, it moves that file to a designated folder inside the project, sets that folder as the path, and creates a newEntity in the database. I...
more »

2017-03-21 12:03 (1) Answers

Cake PHP how to add array to find fields

I'm using cakephp 2.x and I would like to get certain element as field from my model. the problem is with my structure. If I use find all then I recieve this: array(9) { [0]=> ... [1]=> array(7) { ["Person"]=> array(18) { ...
more »

2017-03-21 12:03 (1) Answers

cakephp 2.x delete not working

im trying to delete a record with following code: in Controller: public function delete($id = null) { if (!$this->Modelname->exists($id)) { throw new NotFoundException(__('Modelname ung├╝ltig')); } $this->Modelname...
more »

2017-03-21 11:03 (2) Answers

Why is there a PostFixture in the cakephp core?

I wanted to add a blog to my cakephp 2.6.13 installation and named the table Post. After I was done with everything I ran the tests and discovered, that they fail. PHP Fatal error: Cannot redeclare class PostFixture in /var/www/gutscheinpony/ven...
more »

2017-03-21 10:03 (1) Answers

cakephp 2 complex find all condition

I have a Notifications table with the following fields : | id | event_id | user_id | status | created | There are 5 different status(0,1,2,3,4). The event_id and user_id are foreign keys of their respective tables. What I need to find is all the ...
more »

2017-03-21 10:03 (0) Answers

Make Recording and Store it to Database

I Want to make website recording like this I am using cakePHP Framework. I want to make recording with audio record. There will be 'record', 'stop', 'save', 'clear' and 'send' button. So when i click 'record' i...
more »

2017-03-21 06:03 (0) Answers

Cakephp locale file not working

I am using cakephp2.5. I want to create a website with two languages in english and chinese. I have created Locale/eng/LC_MESSAGES/default.po and Locale/chi/LC_MESSAGES/default.po files and also create msg ids and message strings inside it. I am chan...
more »

2017-03-20 17:03 (0) Answers

Cakephp 3 - Link objects from database

I'm actually a website using CakePhP and I'm stuck with something I don't understand. I have some events(e_pk_id, ...) and some tires(p_pk_id, ...), they are link by a table events_require_tires(pue_pk_fk_evenement_id,pue_pk_fk_pneu_id). But when...
more »

2017-03-20 11:03 (1) Answers