Questions tagged [cakephp-3.4]

Questions about the 3.4.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.4

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

Version 3.4.0 was released in February 2017.

Resources

138 questions
1
vote
0 answers

Clear Memcached on CakePHP 3.4

I'm using memcached engine on CakePHP 3.4. I would like to use a simple command in PHP, empty all content stored in memcached. I followed the documentation, it works very well by emptying an item. Exemple : Cache::delete('products', 'mymemconfig');…
TeO
  • 131
  • 1
  • 1
  • 4
1
vote
1 answer

CakePHP 3.4 use setTemplates() multiple times

I'm trying to use setTemplates() multiple times in a view, but it doesn't work as expected. I have two templates which I want to set when I need them. $bootstrapTemplate = [ 'inputContainer' => '
ad_on_is
  • 1,500
  • 15
  • 27
1
vote
1 answer

How to allow download local file from controller in CakePHP 3

I'm using CakePHP 3.4+ for my application. There is an XML file in local path and needs to be downloaded when on clicking the link. I want to return download from controller's action after checking few requirements as per my application public…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

access model class inside entity class of other model

I am using CakePHP 3.4+ I have written an application with multi level membership. The Pro members will have benefit to view short url for external links which when shared will record the visit count to that url. The original url is stored in…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
1 answer

How to implement CASE WHEN under ORDER BY using CakePHP 3

The SQL: SELECT Students.name AS `Students__name`, Students.role AS `Students__role` FROM students Students WHERE id IN (1053,1056,733,734,735,736,737,739,748) AND name LIKE '%v%' ORDER BY CASE WHEN name LIKE '%v' THEN 1 WHEN name LIKE…
Keval Domadia
  • 4,768
  • 1
  • 37
  • 64
1
vote
1 answer

CakePHP 3 Serve Files From Plugin Webroot

I am under the impression that any files placed in the webroot/ folder of a plugin in CakePHP 3 should be served automagically. However, I have not been able to get a file to be served from that folder... I have created an example…
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
1 answer

CakePHP 3 Skip Migration in Production

I have a Migration that failed in production after executing several commands that I can not execute again, is there a way to skip a migration?
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
1 answer

CakePHP 3 Delete Row From Database using Migrations

I was taking a look at https://book.cakephp.org/3.0/en/migrations.html but I did not see anything about deleting a row from the database using Migrations... How can I delete a row from a table using the migrations shell?
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
2 answers

CakePHP 3 Cache File Permissions

I have a CakePHP 3 app with shells that I run from crontab. When I run the shells through crontab, it creates cache files owned by the user running the crontab, which is not the user that runs apache... Sometimes when I run the crontab the cached…
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
3 answers

Creating Rest API without views using cakePHP 3.5

I'm trying to create Rest API without view and planning to use these api's in angular 2 application. does have any idea about it?
Kumar
  • 214
  • 2
  • 7
1
vote
2 answers

cakephp 3 save empty belongsToMany relation

I have a Shops table which can have Products. Other Shops can have the same Products so I used a belongsToMany relation table ShopsProducts. I can add an infinite number of Products to a Shop and remove them by saving the Shop entity including the…
1
vote
0 answers

Cakephp 3 not Retriving records of associated models

My school model has a many to many relationship with my attribute model joined by attribute_school table. In my Shell folder for cron job i have the following in my main function: $schoolsRaw = TableRegistry::get('Schools'); $schools =…
Yomi Ojo
  • 21
  • 1
  • 3
1
vote
1 answer

Dynamically Loading Plugin Configuration Files in CakePHP 3

Question: How do I load a configuration file from a Plugin/config Directory? Demo Project: https://github.com/CakePHPKitchen/CakeDC-Users-Permissions-Example I am using CakeDC/users plugin and it has a permissions.php file that it loads the RBAC…
Jeffrey L. Roberts
  • 2,844
  • 5
  • 34
  • 69
1
vote
1 answer

Unexpected field 'g-recaptcha-response' in POST data on CakePHP 3

I have created a site using CakePHP 3. I have static page which has contact us form something like this: inside contactus.ctp: Form->create(); ?> Form->hidden('form_type',['value' => 'contact']) ?> …
TheAndroDev
  • 103
  • 1
  • 12
1
vote
1 answer

File Upload CakePHP 3.4

Im trying to get a simple file upload from a form to save in my webroot/img folder, however i'm having some difficulty. This is the form in the view: Form->create($productImage) ?>
Samcar
  • 13
  • 3
1
2
3
9 10