CakePHP 3 - finder not loading correct data

I have a table called Bookings, with the following attributes: id artist_id - foreign key status amount created modified It is associated with tables Artists, Payments and Sessions. In the View, I have used the jQuery plugin DataTables to displa...
more »

2017-02-20 07:02 (1) Answers

CakeSession::_startSession - Slow on Elasticache

We're running CakePHP 2.9, and using an Elasticache Cluster for Session Storage (which is stored via Memcached). We've disabled PHP's in-built session garbage collection as recommended here: https://tideways.io/profiler/blog/php-session-garbage-coll...
more »

2017-02-20 01:02 (0) Answers

Group by subquery on the same table in CakePHP 3

I'm trying to use CakePHP3's Query Builder for the following query, but did not succeed so far... My main problem is that I don't know how should I alias the outer query to access in the subquery. For the full story, I have the following table: ---...
more »

2017-02-19 19:02 (0) Answers

CakePDF not working on CakePHP3

I have been trying for a couple of days now to enable PDFs on my web app. However, I can't make it work. I have the following configured: // AppController.php class AppController extends Controller { /** * Initialization hook method. ...
more »

2017-02-19 18:02 (0) Answers

CakePHP 3: How to use custom pagination?

I don't succeed in using the pagination with a custom query. I follow exactly what's in the doc, but it doesn't work. The point is to paginate a list of records, having the flag 'valid' to 'Y' or 'N'. In the controller: if (!isset($this->request...
more »

2017-02-19 18:02 (1) Answers

CakePHP 3 How to search data

I'm using CakePHP 3.4. I have 2 main models (CourseTypes and Courses). I have created an AJAX call (expecting JSON) to handle updating an online calendar. Everything below works, but I want to expand upon what I have to be able to filter the data for...
more »

2017-02-18 17:02 (0) Answers

piping email to cakephp 2

I'm having problems understanding how I'm meant to receive an email via a cakephp application. I've read a fair bit but I'm not familiar with server settings and trying the tutorials I've seen hasn't worked. I'm not sure if it's something stupid I'v...
more »

2017-02-18 05:02 (0) Answers

Cakephp smtp emails not working

I'm using Cakephp 2.6, I have configured smtp settings as follows in email.php, public $smtp = array( 'transport' => 'Smtp', 'from' => array('support@mywebsite.com'=> 'MYWEBSITE'), 'host' => 'hostingserver', 'port' =>...
more »

2017-02-17 14:02 (0) Answers

CakePHP 3 - attribute not showing up in table

I have a table called Bookings, with the following attributes: id artist_id - foreign key status amount created modified It is associated with tables Artists, Payments and Sessions. In the View, I have used the jQuery plugin DataTables to displa...
more »

2017-02-17 10:02 (0) Answers

CakePHP contain condition cannot use variable?

I guess there is an easy solution for this issue, but i cant seem to find it out. I get back an error saying $p_name equals NULL on the contain Comments query. How is this possible since it was clearly set before. $p_name = "Berta"; $query = $artic...
more »

2017-02-17 09:02 (1) Answers

CakePHP vs CryptoSwift

I'm having some problems making my code work between Swift and my PHP Server. I'm using CakePHP as Framework on my server and your plugin on iOS That's how AES256 works on CakePHP public static function encrypt($plain, $key, $hmacSalt = null) { ...
more »

2017-02-15 18:02 (0) Answers

CakePHP 3 - Count many-to-many Association

I have a database with Rounds and Users. Rounds belongsToMany Users and Users belongsToMany Rounds, so a many-to-many relation. A join table rounds_users was added to do this. EDIT: Used the incorrect phrase here. I meant 'belongsToMany' instead of '...
more »

2017-02-15 17:02 (1) Answers

Override JSON view in RequestHandler in CakePHP

I want to rewrite JSON View in the RequestHandler. So there's a file project_root/lib/JsonView.php. What I want to do is to Import the JsonView.php file in another file in project_root/app/View/CustomJsonView.php. (I think I could use App:import, w...
more »

2017-02-15 15:02 (1) Answers

Use CakePHP Configuration in CSS File

Is it possible to access the configuration from CakePHP(3.x) in a CSS file? For example I would like to define a general background color in the CakePHP configuration file and use it in multiple CSS definitions. I am aware of CSS preprocessors like...
more »

2017-02-15 15:02 (1) Answers

cakePHP 3 migration issue

I made a migration script in cakephp and ran the script using the command "bin/cake migrations migrate" my code in the up() function: $preparedArray=[ 'name'=>'dhruv', 'surname'=>'sharma' ]; $table = $this->table('name'); $table->in...
more »

2017-02-15 10:02 (1) Answers

When session writes

When and where the session writes in CakePHP 2.x. In my webpage there is 2 types of login Admin and user. I made the session setting as write in the database. Configure::write('Session', array( 'defaults' => 'database', 'handler' => ar...
more »

2017-02-15 08:02 (0) Answers