Newest 'cakephp-3.0' Questions - Stack Overflow

Questions tagged [cakephp-3.0]

Questions about the 3.0.x branch of the CakePHP MVC framework. Use this tag in combination with the general [cakephp] tag.

0
votes
2answers
42 views

How to use transactions in cakephp?

I'm trying to use commit with setConnection() but it doesn't work... I have no idea how to make the transaction work in cakephp I found in the documentation this: https://book.cakephp.org/3.0/en/orm/...
0
votes
1answer
40 views

CakePHP3 merge add and edit action

After I add a herd to the system, the user gets redirected to the herdimports controller where he can enter the import data. I would like to have the add and edit form in one action and view. In the ...
0
votes
0answers
11 views

add form won't add record to the database

I'm new to cakephp. I'm trying to create an application and I'm facing a problem. When I try to import some template to use their form to add or update records to the database, it won't, and when I ...
0
votes
1answer
45 views

Paginate and search associated query with dynamic ajax loading - CakePHP 3

Working on an application in CakePHP 3.7 We have 3 database tables with the following hierarchy. These tables are associated correctly according to the Table classes: regulations groups filters (...
0
votes
1answer
13 views

Cake PHP 3.5 route

I have a controller, ShareController, and a method, view: class ShareController extends AppController { public function beforeFilter(Event $event) { } public function index() { ...
0
votes
0answers
39 views

CakePHP 3 - association is not defined - even though it appears to be

I've baked a legacy application using CakePHP 3.7 The database contains 3 tables as follows: regulations, groups, filters. The hierarchy as far as the application goes is: Regulations Groups ...
-2
votes
0answers
37 views

JSON response through cake PHP

I have 3 values in an array i.e : $type = array('remainingContact','draft','completedContacts'); and I want to execute all 3 values and create 3 nested arrays with all three cases. For each case, ...
-1
votes
0answers
21 views

Need chat application plugin for all users to chat as a global group

I'm looking for a messaging plugin for cakephp where all the users that are registered will be able to chat in a global group. Is there one for Cake 3.x ?
0
votes
1answer
25 views

Admad Social Auth route cannot be found

I want to integrate social auth with login and signup in cakephp for which I have used Admad-social-auth plugin.The plugin is working totally fine on local wamp but gives error on server. Any help ...
0
votes
1answer
32 views

Cakephp retrieving row data from a table

I'm attempting to insert data from a row in one table into another following a button click. I have a table containing class information. When the user clicks register, I need to take the id of that ...
0
votes
0answers
27 views

Caekphp associated model data not saving to database

I need help figuring out why my model data will not save to both tables in my database. When I click submit the data only saves correctly to the table being called but not the associated table. My ...
0
votes
0answers
28 views

use Gutenberg editor in cakephp 3

I am looking for a way to create pages with blocks, like in wordpress visual composer or now gutenberg editor can do. I am not using wordpress. What I want to do for example is the following layout of ...
0
votes
1answer
49 views

CakePHP custom finder for belongsToMany association

I'm having trouble applying a custom finder from a behavior on the join table for a belongsToMany association with CakePHP 3.x. My main model Assessment can have numerous UnableToCompleteReasons and ...
0
votes
1answer
18 views

Using MySql DATE function in CakePHP 3 query where clause

Objective: Trying to get all posts on a certain date from the db table(say, I've datetime in the format '2019-03-07 12:30:00' then I would like to get all posts from this date '2019-03-07'). As I ...
1
vote
1answer
43 views

CakePHP Auth->identify() returning false

I'm playing around with CakePHP and can't seem to get the login working. It seems that $this->Auth->identify() is constantly returning false and not allowing me to login. I've read all previous posts ...
0
votes
2answers
35 views

How to contain unassociated entities in CakePHP?

Sample query: TableRegistry::getTableLocator() ->get('Parents') ->find() ->contain([ 'Children' => function (Query $query) { return $query->where([ ...
0
votes
1answer
46 views

Cakephp INNER JOIN (SELECT … )

Cakephp version: 3.5. I have a claims table. A project has many claims. A claim has one project, a number (1, 2, 3 and running), and each number may be revised multiple times. The combination of ...
0
votes
0answers
45 views

Request Timeout - 500 internal server error

I am working in cakephp3.0. And one of my function needs more time to run. When I run that function it shows "500 internal error","This request takes too long to process, it is timed out by the server....
0
votes
1answer
44 views

How to hide empty fields in the table?

At this point, I can see all listed cities. I would like to see only those in which there is an order. How to do it? Thank you in advance for any help! The script is written in cakephp, unfortunately ...
0
votes
1answer
30 views

No response from Ratchet websocket using Apache reverse proxy

I am trying to implement WyriHaximus/Ratchet plugin for CakePHP 3. My cakephp app is running on eg: blah.myhost.com which has a ssl certificate enabled. I've setup my app.php for the plugins ...
0
votes
0answers
24 views

Beautifier for rendered XML view

Is there a way in CakePHP 3 to let framework tidy up (beautify) rendered code? I have an XML view that's full of conditions and I prefer to have indention more aligned to code logic. However when ...
0
votes
0answers
49 views

CakePHP: Authentication adapter “unauthorizedRedirect” was not found

I am using CakePHP with JWT Authentication for Android App Development. While authenticating user, I am receiving and error Error: [Cake\Core\Exception\Exception] Authentication adapter "...
0
votes
0answers
29 views

How to fix bake command error with CakePHP3.7?

I would like to create an app with CakePHP3.77, MAMP, MySQL5.7.25 and PHP7.3.1. I was able to install CakePHP without problem and connect to the database on http://localhost:8888/bookmarker/ but when ...
0
votes
1answer
36 views

What should be the value of token for cakephp JWT authentication from android app?

I'm using JWT auth in CakePHP to handle login action in Android App. I have disabled CSRF protection in Cake and passing token value through "SharedPreferencesConstants" class where token value is set ...
0
votes
1answer
34 views

CakePHP: Unable to save data to parent entity via belongsTo associated child

Problem description I'm trying to configure a CakePHP 3.7 API to save associated data in a child-first manner. The entities - for the sake of example, lets call them Users and Persons - and their ...
1
vote
1answer
48 views

404 Not Found error in preflight OPTIONS when executing a PUT method in CakePHP API with axios in React App

So, we have an API with CakePHP 3.7. We are using resources to generate CRUD methods. The API is hosted in a server with apache2 and is accessed through a manager app using React (this app is a ...
0
votes
0answers
28 views

Error: SQLSTATE[HY000]: General error: 11 database disk image is malformed

I am using cakephp3 sometimes its throwing below error Error: SQLSTATE[HY000]: General error: 11 database disk image is malformed I got the solution from another stackoverflow question. Here is the ...
-1
votes
2answers
47 views

Using stored procedures with cakephp 3.x

I am trying to use a SQL Server stored procedure with cakephp 3.x, but I get a database error. This is my controller: use Cake\Datasource\ConnectionManager; if($this->request->is('post')){ ...
0
votes
0answers
42 views

Missing Template: Error: The view for MyController::action() was not found. using custom View class

Getting error when using custom View class: Requirement: I'm want to separate some of my view login in different View class but also I want to extend the AppView.php class provided by CakePHP by ...
0
votes
1answer
73 views

Using count subquery within CakePHP ORM

I'm looking through the CakePHP docs and I can't see anywhere that explains how you execute a subquery in the MySQL statement. I would essentially like to count the number of credits each user has as ...
0
votes
1answer
44 views

Insert new record to table without primary key (CakePHP)

I need to integrate PhpBB with CakePHP. And in PhpBB there is table phpbb_user_group without primary key: group_id | user_id | group_leader | user_pending When I'm creating new user I need to ...
-1
votes
1answer
19 views

How to create a agree checkbox before submit:

I am very confused about how to implement the agree checkbox using cakephp. i know how to do in php but no idea in cakephp 3.0
1
vote
0answers
38 views

Cakephp v3 Fatal Error with Custom Route class

I am trying to use custom route class. Sometimes when I redirect to urls like www.site.com/neumaticos-bridgestone it returns Fatal Error. But when I refresh the page, the error is hidden I try ...
0
votes
2answers
52 views

not able to pass array from controller to view in cakephp 3 using $this->set('data', array received from find())

Not able to pass array variable form controller to view below code If, I print in controller it is showing "Undefined variable: data" public function report(){ $results=$this->Nodals->find()-&...
2
votes
1answer
86 views

Setup a Docker container with only the docker-compose up command

I have an assessment in which I have to create a Docker container with CakePHP. I already have a working Docker container with CakePHP and I run the following commands for my container: docker-...
0
votes
1answer
53 views

Run function few hours before event occurs

I have one problem. I am learning cakephp 3 and I want to do the folowing: User enters date and time (this is saved into mysql as datetime format) and system needs to send email few hours before this ...
0
votes
0answers
37 views

Cakephp 3.x Full-Text Search With Relevance in MySQL

The goal is to build a full text search engine with relevance quotation. mysql should look like this: SELECT *, MATCH(`title`) AGAINST ('+iphone +case +4s' IN BOOLEAN MODE) * 10 as rel1, MATCH(`...
0
votes
1answer
29 views

How can i load model into the different controller

I have two controllers UsersController and UserRolesController. I want load the UserRoles model into my UsersController for fetching the value of the users with their roles. Can anyone help me on this....
0
votes
1answer
21 views

Cakephp 3 searching a plugin or a solution to read keyword into pdf file

I'm looking for a solution to use on cakephp, I have a directory that contains pdf files, inside my webapp I need to implement a search input, which takes care of finding the file that contains a ...
0
votes
1answer
43 views

Hiding a text input without making it `type=“hidden”`

What I have I'm using the FormController to create inputs. A specific input will be frequently updated by Javascript for internal purposes and I want it hidden. In this case, I can't use type="hidden"...
0
votes
0answers
48 views

Prioritize order of validation between multiple fields?

I have two fields, Car 1' and 'Car 2. I want to have Car 1 in the Form to be required first, but if it isn't then I want Car 2 to be filled in. Basically one of them needs to be filled in but Car 1 ...
0
votes
3answers
71 views

Not getting data from api in cakephp

I am trying to make an api. problem is it does not response value. It shows null. I am using postman. Here I'm keeping json in body with json format. My goal is to show the name when I hit api. Here ...
1
vote
0answers
56 views

IF statement executing else for true variable and true for false variable CAKEPHP

For true I'm receiving "Successfully UNENLISTED(1)!" and for false I'm receiving "Successfully ENLISTED(1)!". dump($swap) will return true and still execute the IF else while if it returns false it ...
-2
votes
1answer
35 views

Use multiple database in same query in cakephp

I have two databases db1 and db2 and both of them are same server. my code is public function test(){ $connection = ConnectionManager::get('db1'); $results = $connection->execute('select ...
0
votes
0answers
35 views

How to integrate any template using cakephp 3?

I am new in cakephp 3.0 Now, What am I trying If I have any HTML template So, How can I integrate with cakephp. Here, I am creating a controller: UsersController src/controller <?php ...
0
votes
0answers
25 views

How to get self referencing many-to-many relationship to work for Cake Bake scaffolding?

I have the following SQL for creating the tables: CREATE TABLE `tests` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB ...
0
votes
0answers
27 views

Error App\\Application when upgrading version of CakePHP from 3.6 to 3.7

My application is working if the version of my cake is 3.6.7 then after upgrading it to version 3.7.* it causes an error when running my application. here's the error at apache: PHP Fatal error: ...
0
votes
1answer
35 views

Enlist active submitted 0 instead of 1 and 1 instead of 0 but still giving their correct Flash Success

When I get Successfully UNENLISTED(1)! the database saves the digit as 1 and when i get the response Successfully ENLISTED(1)! database saves the digit as 0. I'm very lost and confused from my problem....
0
votes
1answer
36 views

Show associated table column as DisplayField in table object in CakePHP 3

I have two tables clients and users, users belong to clients. In UsersTable.php I want to set $ this-> setDisplayField ('Clients.name'); but it does not work. What is the way to do this?
0
votes
1answer
20 views

How do I use the same method in both Controllers and Cells in cakephp 3.7?

I have an utility method in my AppController, and I need to use that method inside a Cell (backend). Is there a standard way to use the same method in both places? I don't want to duplicate code.