Questions tagged [cakephp-3.2]

Questions about the 3.2.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.2

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

Version 3.2.0 was released in January 2016.

Resources

145 questions
0
votes
1 answer

Baking a Controller with Cakephp 3.2 using SQLite3 produces an error in the add() and edit() methods, Why is the code being generated incorrectly?

The error is that when creating the controller code a variable for an associated model is left blank, and that Model's name is left blank. The error happens when creating the controllers for all of my tables, but here is a complete example of one…
0
votes
1 answer

In a CakePHP IntegrationTest "Redis"-class is unknown only when executing the test

I am trying to implement an PHPUnit integration-test for a Controller. Within the controller I instantiate an Object of the PHPRedis-class (https://github.com/phpredis/phpredis#usage): //connect to redis database try { …
Niklas
  • 95
  • 1
  • 9
0
votes
1 answer

Multiple count in ORM is not working

I want to get count of tenancies based on differnet times $start_date = $end_date = $end_date1 = new \DateTime('first day of last month'); $start_date = $start_date->format('Y-m-01 00:00:00'); $end_date = $end_date->format('Y-m-t…
Fury
  • 4,643
  • 5
  • 50
  • 80
0
votes
0 answers

How to instantiate a Class beside Controller, Model and View in CakePHP 3

I would like to load a Class that I have located in src/Bandit/EpsilonGreedy. EpsilonGreedy itself extends an abstract class located in the same Folder src/Bandit/ABandit. When I try to load the class with new App\Bandit\EpsilonGreedy(); I nor get…
Niklas
  • 95
  • 1
  • 9
0
votes
1 answer

CakePHP 3 DeleteAll where first 4 letters are not http

How do i create this SQL statement with cakephp 3; delete FROM bookmarks WHERE substring(url , 4) != 'http' Ive tried; $this->Bookmark->deleteAll('substring(Bookmark.url,4) !=' => 'http',false); Cakephp doesnt like the Substring or LEFT()…
fuzzy dunlop
  • 477
  • 2
  • 10
  • 22
0
votes
1 answer

How to set url parameters into paginator numbers

How to set url parameters into paginator numbers? My url is company/overview/3?page=1&sort=Tenancies.stage&direction=asc In default only the first paginator number has the parameter. How can I apply the parameters to number 2, 3, 4... ? Here is my…
Fury
  • 4,643
  • 5
  • 50
  • 80
0
votes
0 answers

How to get only selected fields from rightJoin() and contain() in cakephp3

cakephp 3.2.3x I am trying to show custom fields from right join which is contained (left joined) with an other table and it is not working. How ever contain custom fields is working. Note 1: When I get rid of contain() my ORM works as I am…
Fury
  • 4,643
  • 5
  • 50
  • 80
0
votes
2 answers

How to retrieve only those records that have at least one associated record?

The data should show only the tenancies that contains data. In normal query normally I do this be right join. I know contain() is left join on default but can contain be right join at all? My query: $properties = $this->find() …
Fury
  • 4,643
  • 5
  • 50
  • 80
0
votes
1 answer

Fatal error because an Error instance is being passed instead of an expected Exception instance

I just installed xampp with php 7.0.4 and a fresh cakephp 3.2.6. I did a lot of research and everything I found shows that they are compatible. However as soon as I go to open the application with a browser, cake replies with an Internal Error. The…
0
votes
1 answer

Default login is not working in cakephp 3.2

I am a newbie to cakephp 3.2.I have done login using cakephp code , but there is a need to create a default login (means irrespective of what is the login id and password is present in database,if i will give the default login username and password…
sradha
  • 2,216
  • 1
  • 28
  • 48
0
votes
0 answers

CakePHP unit tests generating errors on my system

I've come across a couple of issues in CakePHP that I want to submit fixes for, but I want to make sure that any changes I make pass the unit tests. Problem is that the unit tests don't quite work for me with out-of-the-box code! I'm assured that…
Greg Schmidt
  • 5,010
  • 2
  • 14
  • 35
0
votes
1 answer

Cakephp 3 use mock to test controller

I want to test a controller using a mock. In my controller public function myAction() { $email = new MandrillApi(['template_name'=>'myTemplate']); $result = $email ->subject('My title') ->from('no-reply@test.com') …
Ozee
  • 146
  • 1
  • 7
0
votes
1 answer

how to deattach global event in cakephp 3

created a global beforeFind() listener for my find queries but need to detach it for some requests.. $this->eventManager()->off() in controller is not working. i.e. not deattach the event. In my bootstrap.php file : $modelListerner = new…
sanjib
  • 3
  • 2
0
votes
1 answer

CakePHP 3.2 using counterCache Behavior to get an average

I am trying to use counterCache behavior to update an average 'stars' rating from a Reviews table to the Profiles table it belongsTo. Here is my Reviews Table: class ReviewsTable extends Table { public function initialize(array $config) { …
DJ Far
  • 497
  • 5
  • 12
0
votes
1 answer

Ajax Calls in CakePHP 3.x with help of Helpers

I found hints in the CakePHP 3.x documentation that Helpers can help to "build AJAX functionality" (like here http://book.cakephp.org/3.0/en/views/helpers.html#helpers). But I think there is no further and deeper explanation elsewhere in the docs,…
Niklas
  • 95
  • 1
  • 9
1 2 3
9
10