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
1
vote
1 answer

Show custom field in query list in cakephp3

I want to create a dropdown with custom field but my list query append id field into the query. How to show only selected fields in my query. $this->loadModel('CardTypes'); $cardTypes = $this->CardTypes->find('list')->select(['code', 'name']); In…
Fury
  • 4,643
  • 5
  • 50
  • 80
1
vote
1 answer

CakePHP Error: Class App\Controller\AuthComponent not found

I'm working in CakePHP 3.2 and writing an admin panel where only admin can login. There is a separate table admins to store admin credentials. There is users table also which is used for users to register/login from main application. I have to use…
Anuj TBE
  • 9,198
  • 27
  • 136
  • 285
1
vote
2 answers

Cakephp 3 - Name convention in plurals

Maybe this is a simple question but I didn't find it in cookbook. I am confused when name for some plural words with 'ies" Example: City -> Cities Controller: CitiesController Table: CitiesTable Model: City ???? or Citie ??? Now both made error…
TommyDo
  • 663
  • 8
  • 23
1
vote
1 answer

CakePHP 3 AJAX with Pagination

I am new to CakePHP. I have installed CakePHP 3.2.10. I have implemented simple AJAX calls. I have also implemented pagination in normal view. Now I want to show records, loading with AJAX and using pagination. Can anyone guide me how to go about…
Bhargav S
  • 23
  • 7
1
vote
1 answer

Cakephp3 Layout size with zurb foundation

Im wondering how to deal with a problem in cakephp3 thats annoying me. I understand it uses the superb Zurb Foundation for layouts. if i bake my CRUD actions of a typical controller i get 4 view files. But each view file has 4 separate layout…
1
vote
1 answer

saving hasMany always add record instead of updating

I have a hasMany relationship (let's say Post hasMany Comments) I want to edit both the Post and an existing Comment at the same time My code in my comment edit.ctp file I did Form->create($post); ?> Form->input('title'); ?>…
arilia
  • 9,373
  • 2
  • 20
  • 44
1
vote
0 answers

CakePhp 3: Create Validation with dynamic fields

I'd like to create a complex validate: I have 4 tables: products id name price attribute_set_id attribute_sets id name attributes id attribute is_required rl_attributes_attribute_sets id attribute_id …
DanielMescoloto
  • 180
  • 3
  • 16
1
vote
1 answer

How to change the join type of a contained association per find() call?

How to reset the type of joins in different places? Here are my tables: Tenancy Table class TenancyTable extends Table { /** * Initialize method * * @param array $config The configuration for the Table. * @return void …
Fury
  • 4,643
  • 5
  • 50
  • 80
1
vote
1 answer

cakephp 3 date input and database issue

I'm trying to save a date of birth field in the create user view of my app, I'm using bootstrap datepicker to make it more friendly. have it formatted to yyyy-mm-dd to match the sql date format. in the create view, when i pick the date it looks like…
1
vote
2 answers

Unknown methode is showing when calling a methode in controller ,which is present in model of that controller in cakephp 3.2

I am new to cakephp 3.2 I have saved data by calling model in cakephp 2X version in this way. $this->Schools->add_school($schools); I have used the same in 3x,but it not working showing Unknown method "add_school" I have defined the function in…
sradha
  • 2,216
  • 1
  • 28
  • 48
0
votes
0 answers

safari is overrriding input text default value in cakephp3

When using safari browser for a cakephp3.2 application it overrides the default value set in the txtbox. In another browser eg Firefox in windows or IE I get the correct output being displayed as default value. I have tried this in firefox 66 win10…
atown99
  • 109
  • 12
0
votes
1 answer

Remove Parent array if contain is empty in cakephp 3

I have to remove the parent array if the contain is not available or empty. In below code if supplierOffer is empty then I have to remove the SupplierInquiry array but here I am getting the SupplierInquiry array with empty supplierOffer. I cann't…
Devendra
  • 219
  • 2
  • 22
0
votes
1 answer

How to send email in cakephp 3.6.7..?

I am using cakephp3.6.7 while configuring app.php it will show error. Error: Could not send email: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Please help…
0
votes
1 answer

sending a text data between template to controller in cakephp 3

Definition : I want to send text data from the template (ctp file) to the controller but it is not working. What I DO Until now : I have this controller courses and it has function called search as following : /src/Controller/CoursesController : …
user1870982
  • 9
  • 1
  • 2
0
votes
1 answer

multiple belongTo relation in one model for same foreign key in cakephp 3

I have one model SupplierInquiry that has many SupplierInquiryProducts and in SupplierInquiryProducts table I have product_id foreign key and product_id can be from many model. I have applied relation in SupplierInquiryProducts like below …
Devendra
  • 219
  • 2
  • 22