Questions about 3.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.
Questions tagged [cakephp-3.x]
963 questions
0
votes
1 answer
Cakephp 3 subquery expressions
I am trying to create conditional select here based on type field. Why $exp->addCase() call is invalid and it says, that addCase() is unknown method?
$query->select(function ($exp) use ($query) {
$concatPerson =…

makallio85
- 1,366
- 2
- 14
- 29
0
votes
0 answers
CakePhp 3.x not saving datetime correctly
I have events that have a datetime input for the start and end of the event. If I try to save the start 12-8-2015 at 11:30am and the end 12-8-2015 at 12:30pm the event gets save but it makes the date 12-9-2015. I don't know why it is doing this. I…

Battousai
- 503
- 7
- 17
0
votes
2 answers
Full Calendar CakePhp 3.x and Error: XMLHttpRequest cannot load '...'. No 'Access-Control-Allow-Origin' header is present on the requested resource?
I am using full calendar on cakephp 3.x and I am getting this error message only on mobile devices "XMLHttpRequest cannot load https://www.utahreia.org/events/feed... No 'Access-Control-Allow-Origin' header is present on the requested resource.…

Battousai
- 503
- 7
- 17
0
votes
1 answer
InnerJoin in CakePHP 3 returns no rows
I am trying to learn CakePHP 3, but I have run into a problem:
I have two tables languages and rich_text_elements, and want to join them in the following manner:
$all = $this->find()->
select(['i18n','Language.long_name'])->
innerJoin(['Language'…

Tornseglare
- 963
- 1
- 11
- 24
0
votes
1 answer
Remember Me Cookie in CakePHP 3 with auth
How to use "remember me" cookie with auth in CakePHP 3?
I have use the following code in my controller:
if ($this->request->data['data']['rememberMe'] == "on") {
$cookie = array();
$cookie['username'] = $this->request->data['username'];
…

Rishu
- 97
- 1
- 2
- 13
0
votes
1 answer
CakePHP 3: How to include simple page .ctp in default.ctp
Is it possible? if yes, then how to create a simple page that uses the default.ctp page.
So I want something like the "include" features because my single pages have the same header and footer as my default.ctp and I don't want to write the import…

levolutionniste
- 424
- 1
- 6
- 16
0
votes
1 answer
Accessing member function in YTable from XController
This is a general question about CakePHP 3, I have a substantial OOP background, but I'm new to PHP and am stuck using Cake for a project. I guess this revolves around conventions.
So say I have some model entity, Apple, with a matching ApplesTable…

Mason Dixon Line
- 43
- 8
0
votes
2 answers
Validation doesn't work - CakePHP 3
I am trying to add validation on change password function but it doesn't work.
I have added
->add('repeat_password', [
'equalToPassword' => [
'rule' => function ($value,…
0
votes
3 answers
File fails to upload when using xety/cake3-upload plugin
I am not able to upload a file from one folder to another in CakePHP. Here is my code.
First I loaded the plugin and added this code in ProductsTable.php
$this->addBehavior('Xety/Cake3Upload.Upload', [
'fields' => [
'productimg_file' =>…

ankit12
- 5
- 1
- 8
0
votes
2 answers
How to define a unique alias for a self joining association?
I'm a cakephp newbie. I designed a mysql database, with an InnoDB table CompetitionRegions with a foreign key referencing the table itself. A foreign key constraint is in place.
cake bake couldn't generate proper code for this automatically, because…

vortex
- 81
- 1
- 3
0
votes
0 answers
How to check ajax response before the request is considered completed in CakePHP 3.x?
I have been trying to add two users (one at a time) and then pay using stripe. I originally thought the problem lied in the fact that ajax is asynchronous, posting both user forms at the same time, but I now believe it is because when I get the…

Battousai
- 503
- 7
- 17
0
votes
1 answer
Cakephp 3 habtm with additional data
While going through a cakephp 3 tutorial about bookmarks and tags I've struggled with a problem: I want to add the third field to the users_tags table (tag_type: important or not), but when it saves the data it rewrites previous values to the…

Andrew
- 13
- 5
0
votes
1 answer
cakephp3 restrict controller use depending on user type
I am using cakephp3. I have a simple web application that has users. I have two user types, Admin and Standard. I want to limit Standard user to only view and index data. Whereas Admin type user should be able to add, edit, delete, view and index…

Akshay Malhotra
- 49
- 3
- 7
0
votes
1 answer
CakePHP 3.0 Default Theme for Plugin
All,
I have a structure as follows:
Main Application
Custom Theme Plugin
Plugin with AppController and other Controllers
I am using the custom theme plugin for my main application but the second plugin is defaulting to using the standard…

KaffineAddict
- 436
- 2
- 11
0
votes
1 answer
CakePhp 3.x Continue session from out of the app
I'm building a new version of a website in cakephp 3.x. Since I rebuild in phases,I need interaction between parts of the new site and the old site. The best way to do this at this moment is with the use of $_SESSION.
My problem is that the cakephp…

Joost
- 418
- 5
- 17