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.

Use this tag for questions specifically about version 3.0.x of the CakePHP MVC framework, and combine it with the general tag. If your question applies to CakePHP more generally, use only the tag.

For questions specifically related to other minor versions of the framework, use the other version-specific tags like , , , etc.

CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.

Version 3.0 was released in March 2015. The latest 3.x version of the framework is 3.10.

4481 questions
68
votes
18 answers

CakePHP 3.0 installation: intl extension missing from system

Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error: cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system However, I know for sure that intl is…
Juan Carlos
  • 1,073
  • 1
  • 9
  • 13
26
votes
2 answers

Check if record exists in CakePHP3

In CakePHP 2 I always used empty to check if there any result. Modelname->find('first', ['conditions' => ['field' => 'value'] ] ); if ( empty($result) ) { // Bad Request } In CakePHP 3 it looks weird to me. $fancyTable =…
bastey
  • 668
  • 2
  • 11
  • 17
25
votes
6 answers

SQLSTATE[HY000] [1045] Access denied for user 'username'@'localhost' using CakePHP

I am new to PHP and CakePHP. I am finding problems while wiring my database using CakePHP. Below is my application configuration. I am on Bitnami WAMP stack 5.4.40-0. I am using CakePHP 3.0.4 to create a web MVC application Entry for datasources in…
saurav
  • 5,388
  • 10
  • 56
  • 101
22
votes
1 answer

CakePHP unit test not recognizing fixtures

I'm on CakePHP v3.x with phpunit v5.1.3. and my unit test does not seem to be recognizing the existance of my fixtures. It appears that the tests are reading from the local (default) database connection. Here's my TestCase class: namespace…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
22
votes
10 answers

How do you get the last insert ID in CakePHP 3.0?

Working with the CakePHP 3.0 beta, seems like a simple problem, but I've searched through the docs and can't find anything. After inserting a new record using $this->Model->save(), I'd like to the get the auto_increment primary key ID of the newly…
ben921
  • 566
  • 1
  • 4
  • 7
20
votes
6 answers

installing cakephp 3 manually, without composer

I need to install CakePHP 3 in an old-fashioned upload-unzip-run way. The archive I've downloaded from cakephp/cakephp/tags does not contain the default folders like webroot, Model etc., which means it's not complete. The official documentation does…
ᴍᴇʜᴏᴠ
  • 4,804
  • 4
  • 44
  • 57
19
votes
5 answers

phpunit mock - method does not exist

I recently updated PHPunit from 5.3 to 5.5 in an IntegrationTestCase of an app that is CakePhp 3.x based. and I don't understand how to update my mock generation scripts. Originally I created my mock like this: $stub = $this->getMock('SomeClass',…
David Albrecht
  • 634
  • 1
  • 4
  • 15
18
votes
5 answers

CakePHP 3: Model Unit Test fails - "duplicate key value"

I'm using Postgres (which I think is related to the problem), and CakePHP 3. I have the following unit test to just check to make sure that a valid dataset can get saved by the model. When I run the following test, with a standard "bake'd" Model…
Chris Mielke
  • 648
  • 4
  • 16
17
votes
1 answer

What means Call to a member function on boolean and how to fix

I'm new with cakePHP 3. I have created a controller and model where I call a function to get all users from the database. But when I run the code below I will get the following error "Call to a member function get_all_users() on boolean". what…
CodeWhisperer
  • 1,143
  • 2
  • 19
  • 39
17
votes
3 answers

How to join multiple tables using CakePHP 3?

I am using CakePHP 3.x. What I want is to be able to call $this->Categories->find() and then join Topics on Topics.cat_id = Categories.id and then join Posts on Posts.topic_id = Topics.id. I don't get any errors but the only data I'm getting back is…
Wisd0m
  • 521
  • 1
  • 5
  • 14
16
votes
0 answers

Cakephp 3 converting cakephp 2 cookies

we need to read Cakephp 2 user cookies in Cakephp 3. But it seems like during update, CakeCookie tag was removed from cookies. So each Cakephp cookie is seperate. Regarding to here, Cakephp 3 can read old cookies if they were written with AES. But…
trante
  • 33,518
  • 47
  • 192
  • 272
16
votes
1 answer

How can I use my own external class in CakePHP 3.0?

I am creating an application in CakePHP 3.0, in this application I want to draw SVG graphs of data using a php class that I have written. What would be the proper way to go about using this class in my CakePHP 3 project? More specifically: What are…
Jon Lachmann
  • 381
  • 1
  • 3
  • 10
16
votes
2 answers

How to filter by conditions for associated models?

I have a belongsToMany association on Users and Contacts. I would like to find the Contacts of the given User. I would need something like $this->Contacts->find()->contain(['Users' => ['Users.id' => 1]]); The cookbook speaks about giving conditions…
rrd
  • 1,441
  • 2
  • 15
  • 36
16
votes
5 answers

How to import vendor files in CakePHP 3x

I'm working with CakePHP 3(beta 2) version recently launched. I need to integrate Facebook Login using PHP SDKs and I'm not clear with importing vendor files in this version. In CakePHP 2x, I had used App::import('Vendor', 'Facebook', array('file'…
G.J
  • 477
  • 1
  • 7
  • 22
15
votes
6 answers

Cakephp 3.x: SQLSTATE[HY000]: General error: 11 database disk image is malformed

I'm getting this error when I upload my application to linux. This is working fine on my local windows system but gives me error on linux server. When I search regarding this then I found this is sqLite related issue. If this is sqLite issue then…
Lakhwinder Singh
  • 5,536
  • 5
  • 27
  • 52
1
2 3
99 100