Questions tagged [cakephp-3.1]

Questions about the 3.1.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.1

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

Version 3.1.0 was released in September 2015.

Resources

109 questions
0
votes
2 answers

How to get date drop downs automatically with form input CakePHP 3?

So I have already created a way to add testimonials and there is a section of the form to add a date of the testimonial. In my database table it is set up as a date type. On my form I only have: Form->input('testimony_date'); ?> In my…
Battousai
  • 503
  • 7
  • 17
0
votes
1 answer

Should CakePHP 3 CSRF be active for entire app?

I have just discovered that the CSRF component is now separate from the security one and needs to be loaded separately. I was wondering should I just load it for the entire app or only for vulnerable pages/actions. I have an app with 6 frontend…
Keith Power
  • 13,891
  • 22
  • 66
  • 135
0
votes
1 answer

CakePHP Map/Reduce or alternative?

I have an Invoices Table and a LineItems Table. I want to be able to return the invoice total when I get a list of the invoices on the index action. So I would like to return the Invoice, LineItems and the total of LineItems.price field as a…
KaffineAddict
  • 436
  • 2
  • 11
0
votes
1 answer

CakePHP 3: Setting options for 'contain' when paginating

What's the correct way to limit the number of contained associated records when paginating? The docs don't appear to address how to set options for 'contain' while paginating, but $paginate['contain']['AssociatedModel']['limit'] = 1; seemed to make…
Phantom Watson
  • 2,667
  • 4
  • 25
  • 39
0
votes
1 answer

CakePHP 3: Not Sure Why Cache::read() Is Not Working

I have a SettingsSiteTable object with the following method for reading settings in the database and storing the results in a cache. // GET ALL CONFIG SETTINGS function getConfigs(){ if(($settings_site = Cache::read($this->key)) === false) { …
bowlerae
  • 924
  • 1
  • 14
  • 37
0
votes
1 answer

How to delete data in custom finder method in CakePHP 3

I want to delete data in custom finder method. Custom finder method document My code: public function findPREACTIVE(Query $query, array $options) { $query->delete() ->where(['member_status' => -1]) ->andWhere(['registered…
Nguyễn Anh Tuấn
  • 1,023
  • 1
  • 12
  • 19
0
votes
0 answers

Does CakePHP3 suppsed to manage multiselect datas by itself?

I'd like to know if CakePHP3(.1) is supposed to manage multiselect values by itself when we edit an object? I mean, check already selected options and affect modifications like for simple datas. According to my tests (but maybe I didn't initialised…
fralbo
  • 2,534
  • 4
  • 41
  • 73
0
votes
1 answer

Cakephp3: $this->Auth->user('id') in AppController

I got stuck at a certain problem with the use of $this->Auth->user('id') in AppController. It returns following Error: Error: Call to a member function user() on null Now what I want to do: I want to force everybody to get a proper profile. So I…
Andreas Witte
  • 281
  • 1
  • 2
  • 14
0
votes
1 answer

How can I generate a pdf using CakePhp v3.x

I'm using CakePHP v3.x, how can I generate a PDF file? There is the possibility to generate an "only for download" or "only for print" file? (which doesn't need to be saved on server)
0
votes
1 answer

Build query at CakePHP3

I am trying to get the count of Comments for each Shop, and am really stuck on this step. Is it possible to do it, and how? public function display() { $this->loadModel('Shops'); …
0
votes
2 answers

Pagination at App\View\Cell CakePHP3?

How I can use Pagination at App\View\Cell CakePHP3? I have tried use it like component,and directly.
0
votes
2 answers

How to search type datetime in FriendsOfCake/Search plugin?

I did use FriendsOfCake/Search plugin, everything was fine until i do search created datetime. When i submit search form, the created variable become to http://localhost:8765/admin/logs?created=2015%2F10%2F10 and i cannot find any record. How to…
Nguyễn Anh Tuấn
  • 1,023
  • 1
  • 12
  • 19
0
votes
0 answers

Filtering data based on selected row of associated table in cake 3.x

I have three tables: 1 lab_categories (columns include id, category) class LabCategoriesTable extends Table { public function initialize(array $config) { parent::initialize($config); $this->table('lab_categories'); …
medhybrid
  • 48
  • 6
0
votes
1 answer

CakePHP 3: How the Behavior handle multiple data?

I want to create a CakePHP Behavior that will handle the data before they are stored in the db. For example I have Posts add form like: // Post title echo $this->Form->input('title',['value'=>'aaa']); // Post has many Photos (names) echo…
Salines
  • 5,674
  • 3
  • 25
  • 50
0
votes
1 answer

Where should I create a template for a json view in CakePHP 3?

I am using CakePHP 3.1 and trying to render the json index response for User model. I followed the CakePHP manual page and created index.ctp under the directory src/Template/Users/json/, but the file does not get hooked by the controller. I also…
taro
  • 699
  • 1
  • 9
  • 20