Questions tagged [cakephp-3.x]

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.

963 questions
1
vote
1 answer

CakePHP use $this in view function

In my CakePHP3.6 project I use the TreeHelper to create my menu. In my view (pages/index.ctp) I use: Tree->generate($pages,['alias'=>'title']); ?> Which creates a basic unordend list. With TreeHelper I can use a callback function to…
GreyRoofPigeon
  • 17,833
  • 4
  • 36
  • 59
1
vote
1 answer

How to make Text::slug() convert german umlauts properly?

I am using CakePHP 3.6, and when I am using words with german umlauts like: Text::slug('Grundstücke') I will get: Grundstucke (where ü = u) but that's not correct, I should get: Grundstuecke (where ü = ue) Is there an option to set so that…
user1555112
  • 1,897
  • 6
  • 24
  • 43
1
vote
1 answer

Case insensitive authentication CakePHP 3

I want to make the username check on my CakePHP app case insensitive. Currently my Auth component is loaded like this: $this->loadComponent('Auth', [ 'loginAction' => [ 'controller' => 'Users', 'action' => 'login' ], …
Bird87 ZA
  • 2,313
  • 8
  • 36
  • 69
1
vote
2 answers

how to cakephp 3.6 database and file logs

How can I incorporate both database and file logs in cakephp 3.6? the function for log file already exist, and here it is(ProjectLog.php):
andil01
  • 377
  • 4
  • 19
1
vote
2 answers

CakeDC Users Plugin Composer installation

I'm using CakePHP 3.6.2 and trying to install the CakeDC Users plugin with Composer gives me the following error message: Using version ^7.0 for cakedc/users ./composer.json has been created Loading composer repositories with package…
Lucky
  • 95
  • 1
  • 7
1
vote
3 answers

Infinite Login Loop after CakePHP 3.6 update

in my application, based on CakePHP, I'm using. When I'm logging in using the URL /manager/login (corresponding to LoginController, Managerr prefix) everything is OK. When I logout or I use /manager the result is the…
1
vote
0 answers

Cakephp 3.5 custom validation reading data from model

My code below works, the problem is that it's not efficient. Background Users can upload data from a spreadsheet to populate an app I am working on. Several of the fields that they upload exist in tables and are used to populate select boxes or…
taekwondoalex
  • 386
  • 4
  • 12
1
vote
1 answer

Searching records conditions with hasMany model Cakephp3

I have Orders model with hasMany OrderProducts model. below is my code.I have added search functionality using DataTable jquery plugin.Each OrderProducts contain ref_code. I want to add search like fetch all Orders which has OrderProducts which…
Dhara Parmar
  • 8,021
  • 1
  • 16
  • 27
1
vote
1 answer

How to create a hasOne association that joins on multiple foreign keys via an OR condition?

I'm trying to join a table (Connections) twice from another table (Ports). The conditions are: One port can have one or no connection One connection has one from-port and one to-port The structure is: Table Ports: id number Table…
Steve Kirsch
  • 175
  • 1
  • 10
1
vote
1 answer

CakePHP 3.x Contains GroupBy

I am attempting to do a GroupBy on an associated table via contains -> conditions, however I am getting the following error... Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual…
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
1 answer

cakephp 3 howto add active to paginator sort class?

With the last release of Bootstrap, the .active property is set on the link class. How could we add this property to a Paginator->sort ? An example : $this->Paginator->templates([ 'sort' => '
dype
  • 500
  • 1
  • 4
  • 15
1
vote
1 answer

Cake - Setup routing to support versioned API controllers?

I want to be able to support multiple versioned endpoints from my api simultaneously, such as: /api/v1.1/counties/get /api/v1.2/counties/get But in trying to implement the routing for this, a bit perplexed as to how Cake wants this as I keep…
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
1
vote
1 answer

Standard method to find and edit front-end files in CakePHP

I have recently been asked to take over the administration of a website that is built on CakePHP 3.x. I have never worked with CakePHP before. Everything I have read talks about using a command line interface, but I haven't done this since I was in…
1
vote
1 answer

How to get last month row sum in cakephp 3

I need to get last month transactions amount sum , I wrote query but getting error Error: Call to undefined function App\Controller\YEAR() // sum of total received amount $conditions['transaction_type']=1; …
Satu Sultana
  • 527
  • 1
  • 11
  • 23
1
vote
1 answer

CakePHP 3 Get model and method name for Auth finder

Anybody know how to get model and method name used in Auth finder option? I know when I set custom finder can get the name from $this->Auth->config();, but how to this for default finder?
kicaj
  • 2,881
  • 5
  • 42
  • 68