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
1
vote
1 answer

Where to set CakePHP 3 cookie config

I want to set the config for the cookie component but I am unsure where to add the code. Do I set it in the AppController or the bootstrap? public function initialize() { parent::initialize(); $this->loadComponent('Csrf'); …
Keith Power
  • 13,891
  • 22
  • 66
  • 135
1
vote
2 answers

CakeDC Users plugin: Use email field as a username

Is it possible to configure CakeDC's Users plugin to use email field as a username? By default there are both username and email fields in Users plugin and all work great! But I would like to use email as the username for the authentication, so the…
1
vote
0 answers

CakePHP 3.1 : My validation for translate behaviour fields, need some help in review/comment

I have worked on a hook for validate my translated fields, based on this thread : https://stackoverflow.com/a/33070156/4617689. That i've done do the trick, but i'm looking for you guys to help me to improve my code, so feel free to comment and…
1
vote
1 answer

How to Filter Associated Data using FriendsOfCake Search plugin for CakePHP 3.1.0

Plugin: FriendsOfCake\Search CakePHP: 3.1.0 I'm currently adding the ability to filter my Orders controller on the index() method. I'm needing to be able to search Orders my the name of the User who placed the order. Each order is associated with…
hulk66049
  • 33
  • 7
1
vote
0 answers

Fatal Error when implementing FriendsOfCake\Search to query a date range using CakePHP

I'm trying to implement the FriendsOfCake\Search plugin in a CakePHP. I'm not 100% sure that I've implemented the search type correctly, but when I submit my form to try and use a date to search I'm receiving the following Fatal Error: Error: Call…
hulk66049
  • 33
  • 7
1
vote
1 answer

Missing Controller error for baked plugin in CakePHP 3.1

I did a fresh installation of CakePHP 3.1. Then I baked a plugin. Then I baked a plugin controller. Done as per the example in the documentation: http://book.cakephp.org/3.0/en/plugins.html#creating-your-own-plugins But when I go to…
1
vote
2 answers

Cakephp 3 callbacks, behaviors for all models

I just started reading cakephp 3 docs (I have been developing with cake 2.x for some time) and want to migrate some website from 2.x to 3. In cake 2 in my AppModel I have some callbacks, particularly beforeFind and beforeSave, that contain some…
dav
  • 8,931
  • 15
  • 76
  • 140
1
vote
3 answers

How to login user without redirecting cakephp 3?

I have an application where the user is added using ajax. I want to log them in, but not redirect them so that the other form(s) can be submitted. Is this possible? I have searched the documentation, but couldn't see anything to make it not…
Battousai
  • 503
  • 7
  • 17
1
vote
1 answer

CakePHP 3.1: Language letter codes to use with translate behaviour (i18n)

Inconsistent? In the chapter about translate behaviour in the CakePHP 3 book there are three-letter codes used, derived from English names rather than native names of language like ISO 639-2: eng (english) spa (spanish) with this example to change…
Oops D'oh
  • 941
  • 1
  • 15
  • 34
1
vote
0 answers

cakephp 3 controller action -> how to make it smart

I implementet a controller action in the maybe most unelegant way. How could this made better? Table classes are just like after bin/cake bake. I think the part where the Entity is created could be simplyfied very much. What I'm doing: Books…
1
vote
1 answer

CakePHP 3.1 installation: Internal Server Error 500

I have installed CakePHP 3.1 on my apache server via composer, but after that I get an 500 error. The .htaccess file looks good. "AllowOverride All" is set to All for vhosts and */htdocs. The log shows this line: [Thu Sep 24 10:15:20.193955 2015]…
Shaun
  • 11
  • 1
  • 3
1
vote
1 answer

Respond as XML not working since cakePHP 3.1

I need to render an XML+XSL template in my application, and it used to work with cakePHP 3.0. I have made the switch to 3.1 recently and it has stopped working. The problem is that I was having a formatted view of my XML, while now I just get a…
ToX 82
  • 1,064
  • 12
  • 35
1
vote
0 answers

CakePHP 3.1 routes with conditional statements

I am using CakePHP 3.1, I am trying to create a route that works like this pseudo code :category/:sub-category/:slug if(:subcategory doesn’t exist){ treat as :controller/:action } :category/:controller/:action :category/:controller if(:controller…
artSir
  • 540
  • 1
  • 8
  • 29
1
vote
1 answer

$this->viewPath is not working with CakePHP 3.1

I have updated my cakePHP application to 3.1 through composer, and I'm trying to fix all the small or deprecated warnings. I could easily fix the $this->layout stuff but I don't understand how to fix viewPath errors. Looking at the migration guide…
ToX 82
  • 1,064
  • 12
  • 35
0
votes
1 answer

How to send email in cakephp 3.6.7..?

I am using cakephp3.6.7 while configuring app.php it will show error. Error: Could not send email: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Please help…