Questions tagged [cakephp-3.1]

Questions about the 3.1.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag. If your question applies to CakePHP more generally, use only the [cakephp] tag.

CakePHP 3.1

CackePHP is a PHP development framework using Associative Data Mapping, Front Controller and MVC design patterns.

Version 3.1.0 was released in September 2015.

Resources

109 questions
19
votes
3 answers

Intervention Image: Save image directly from an url with original file name and ext?

How to get the filename, when taking image from a remote server? And how to save with original size and filename? // Take remote image $img = Image::make('http://image.info/demo.jpg'); // how to save in the img/original/demo.jpg $img->save(????); I…
Salines
  • 5,674
  • 3
  • 25
  • 50
7
votes
4 answers

Session destroyed out of nowhere in PHP

I am experiencing issue with a session being destroyed out of nowhere: session_start(): Failed to decode session object. Session has been destroyed. Kind of impossible to replicate the issue since I got this thrown in my server log. Any ideas what…
radioaktiv
  • 2,437
  • 4
  • 27
  • 36
7
votes
1 answer

Confusing Validation vs. Application Rules in CakePHP3

Multiple questions about validation which may belong together, because they are all kind of adressing the new validation concept in CakePHP 3. I have read the chapters (1, 2, 3) in the cookbook multiple times but honestly I don't understand how to…
Oops D'oh
  • 941
  • 1
  • 15
  • 34
5
votes
2 answers

Cakephp3.1: Using matching() and notMatching() on the same associated model at once

I want do implement a search function for recipes and their associated ingredients. The user should specify ingredients that he wants to exclude from the search and at the same time ingredients that are contained in the recipes he is looking…
5
votes
1 answer

CakePHP deleteAll for many to many relationship does not remove join records

I'm on CakePHP v3.17 w/ Postgres 9.4 I'm trying to get $this->SomeTable->deleteAll([...]) to remove the records in the join table too. Imaging a bus system with a table for Stops and a table for Routes. Stops are associated with many routes (because…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
5
votes
1 answer

CakePHP 3 changing the radio input template

Cakephp 3 create a radio container with label -> input like that
jlafforgue
  • 287
  • 2
  • 5
  • 15
5
votes
1 answer

CakePHP 3.1 patchEntity always marking belongsToMany associations as dirty when clean

So I noticed that If I patch an entity (edit method) and whether or not I make any data changes to the record if it has belongsToMany associations it marks them as dirty. I would expect that if I make no changes to the BTM multiple select in the…
darensipes
  • 674
  • 6
  • 9
5
votes
3 answers

CakePHP 3: Class 'Configure' Not Found

I just started with CakePHP v3.1.3 yesterday and I'm migrating teeny tiny bits of my CakePHP 2.4.2 site over at a time. Mostly just trying to get an understanding of the changes. I'm having an issue with Configure::read(). A little background info:…
bowlerae
  • 924
  • 1
  • 14
  • 37
5
votes
3 answers

session_start() is not success when use multi byte into the session in cakephp3

Recently I started to use cakephp3.1 and I get the error that bellow. Warning (2): session_start(): Trying to destroy uninitialized session [CORE/src/Network/Session.php, line 324] Warning (2): session_start() [function.session-start]: Failed to…
4
votes
1 answer

How to configure PhpStorm 10.x to run unit tests in CakePHP 3.x?

Does anyone have a verified method to configure PhpStorm 10.x to run unit tests in CakePHP 3.x? edit: after @ndm's answer I fixed my PhpStorm configuration, adding "phpunit.xml.dist" to PHPUnit > Test Runner: Checked Default configuration file. now…
Zbigniew Ledwoń
  • 682
  • 1
  • 6
  • 19
4
votes
2 answers

Use one date format in whole project of cakephp 3.x

This might be a simple question. Is there any way that I can set in my project just a single date format and have this date format everywhere. And by everywhere I mean the view, edit, index actions. The format I need to have is Y-m-d H:i:s and it…
gmponos
  • 2,157
  • 4
  • 22
  • 33
4
votes
1 answer

Pagination on custom Array in CakePHP 3

I am having custom array like: [business] => Array ( [55] => Array ( [id] => 1 [name] => abc [contact] => 1325467897 ), [96] => Array ( [id] => 5 [name] => xyz [contact] =>…
3
votes
0 answers

Image is not displaying using TCPDF

I am working in CakePHP 3 application. Here I am using TCPDF for PDF Generation. Everything works fine except image. Image is not displaying. Here my pdf() action file: public function pdf() { $this->loadModel('Users'); …
3
votes
1 answer

Subqueries in CakePHP 3?

I have two tables products and product_categories that are associated through a third table, products_categories_products, according to CakePHP BelongsToMany conventions (Edit: these associations are established in ProductsTable.php and…
Libertie
  • 141
  • 1
  • 10
3
votes
2 answers

How to get validation when saving multiple records with newEntities() CakePhp 3.x?

For some reason I am not getting any validation errors when saving multiple records. I can grab the errors using print_r($user->errors()); but they are not automatically injected into the form like when adding a single user. According to the docs…
Battousai
  • 503
  • 7
  • 17
1
2 3 4 5 6 7 8