Questions tagged [cakephp-3.6]

Questions about the 3.6.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.6

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

Version 3.6.0 was released in April 2018.

Resources

47 questions
0
votes
1 answer

How to render pdf from HTML using CakePdf? I followed the instructions given in github but getting an error 'Failed to load PDF document'?

I installed the plugins of CakePdf using composer. So in my vendor folder I have CakePdf plugin & other dependencies. I downloaded wkhtmltopdf and installed it in a directory. The directory is C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe Next by…
nishan
  • 51
  • 1
  • 4
0
votes
1 answer

Cakephp 3 : How to add a css class with all input field

I am trying to add a css class "form-control" with my all input field using Cakephp Helper. I already created a Helper class BootstrapFormHelper extends Helper { protected $_defaultConfig = []; public function control($fieldName, array…
Satu Sultana
  • 527
  • 1
  • 11
  • 23
0
votes
0 answers

Modelless form redirect url not working cakephp 3

I have a user login form that is not in the login.ctp file. It's in my default layout, therefore I had to clearly specify the login url in the $this->Form->create like so: $this->Form->create(null, array('url' => ['controller' => 'Users', 'action'…
user765368
  • 19,590
  • 27
  • 96
  • 167
0
votes
2 answers

Translate text in config folder cakephp 3

I'm trying to internationalize a CakePHP 3 application using cake i18n extract. All the texts coming from src folder are translated fine, but I have some text that I put inside config/bootstrap.php but those don't get translated even though I placed…
user765368
  • 19,590
  • 27
  • 96
  • 167
0
votes
1 answer

CakePHP 3.6.11: Update field base on dropdown value

I have this tables: customers[id, name, surname, phone, text, balance, created] service_types[id, title, price, length, is_subscription, created] customer_service_types[id, customer_id, service_type_id, price, created] In add.ctp of…
netdev
  • 496
  • 1
  • 5
  • 22
0
votes
1 answer

CakePHP 3.6.11: store selected value from dropdown to database

I have these 3 tables: customers: customerstable services: servicestable customerservices: customerservicestable With this relation in CustomerservicesTable.php: $this->belongsTo('Customers') …
netdev
  • 496
  • 1
  • 5
  • 22
0
votes
2 answers

CakePHP 3.6.11: Where clause of joined tables

I have these 3 tables: customers: customerstable services: servicestable customerservices: customerservicestable With this relation in CustomerservicesTable.php: $this->belongsTo('Customers') …
netdev
  • 496
  • 1
  • 5
  • 22
0
votes
1 answer

In cakephp 3.6, How to change user finder query for auth component?

For cakephp 3.6, cakephp.org tell how to customise user finder query for auth component at following link: link But I am not getting how to implement it? I have 'department_id' column in users table which belongs to departments table. I want to…
Gurpreet Kaur
  • 19
  • 1
  • 7
0
votes
1 answer

CakePHP 3.6.11: create dropdown in ctp from another controller

I have customers(id, name) and services (id, title, isSubscription), I want to add a dropdown list in the add.ctp of Customers which will contain all the titles of Services where isSubscription is true. How I can achieve that? There is no relation…
netdev
  • 496
  • 1
  • 5
  • 22
0
votes
2 answers

How to write these line of code in cakephp 3.x

I am very new in cakephp and i have to upgrade a cake project from version 1.1 to 3.6. I do not know how to convert these lines of code to cakephp 3.6: App::import('Model', 'SystemMenu'); $system_menu =& new SystemMenu(); SystemMenu is an…
tiepvut
  • 90
  • 9
0
votes
1 answer

Cakephp: AuthComponent Evaluation Order and how to redirect to an action

good day everyone, regarding auth component I am doing some tests to understand better the tool, in a probe of concept i want that an authenticated admin user be authorized to access any action, but if the authorized user has the "supervisor" role…
Josexato
  • 50
  • 6
0
votes
1 answer

cakephp 3.6 CSRF token mismatch in post request

When I submit I Will get following error. I have loaded CSRF Component. Let me know why this error coming. Thanks
Ankit Solanki
  • 41
  • 1
  • 8
0
votes
1 answer

i18n::setLocale cakephp 3.6

In a CakePHP 3.6 application, I have the following in beforeFilter method of AppController: public function beforeFilter(Event $event) { parent::beforeFilter($event); $lang = $this->request->getQuery('lang'); if(!empty($lang) &&…
user765368
  • 19,590
  • 27
  • 96
  • 167
0
votes
0 answers

defining cron jobs with Cakephp 3.6

I'm trying to setup a cron job to run a console command every minute. class RescanCommand extends Command { public function sendMail() { $email = new Email(); // Sample SMTP configuration. Email::setConfigTransport('mailtrap', [ …
akano1
  • 40,596
  • 19
  • 54
  • 67
0
votes
1 answer

Where to use Auth->allow and Auth->deny in CakePHP 3

I see that in the CakePHP 3 documentation examples the Auth component allow and deny functions are used in initialize function of the controllers. Whereas I see some examples online and on stackoverflow where people use those methods calls in…
user765368
  • 19,590
  • 27
  • 96
  • 167