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
2
votes
0 answers

CakePHP 3.1-rc1 utf-8 special chars output

During the migration from 2.6 to 3.1 may encounter problems with the display of special characters in the Croatian language. The content is taken from the database. Content is stored in a database via CakePHP 2.x applications, and can be displayed…
Salines
  • 5,674
  • 3
  • 25
  • 50
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

How do I count unique page view count to my web page using Cakephp 3.0?

I'm trying to implement total unique page view count to my webpage, Any one knows that how to do that just give me an idea to implement using CakePHP 3.0
Kumar
  • 214
  • 2
  • 7
1
vote
1 answer

cakephp 3.1 mysql has gone away

I have a Shell script that runs continuously on a loop. It checks the database for records and alters them if needs be. set_time_limit(0); while(true){ try{ $this->out(mysql_ping()); …
Mark
  • 2,423
  • 4
  • 24
  • 40
1
vote
1 answer

Curl PUT Request and empty request data (rest api)

I am trying to make a PUT request, in order to edit some user's data, but I am receiving empty data instead of what I'm sending through my request. I have tried with postman (a chrome plugin) and with a custom php snippet: ?php $process =…
ToX 82
  • 1,064
  • 12
  • 35
1
vote
1 answer

Including sidebar in Cake PHP template

I'm trying to create a sidebar in my template but I'm getting Cake\View\Exception\MissingElementException. I've created sidebar.ctp in /src/View/Element/ directory, and call it like this : element('sidebar') ?> How can I fix this ?
sk001
  • 561
  • 6
  • 27
1
vote
1 answer

matching associations and no associated record cakephp 3

I have an association of Price belongsTo Season I am trying to query all prices that match a specific date range when passed in the season as well as any that have none (Prices.season_id=0) Here is what I have: // build the query $query =…
timstermatic
  • 1,710
  • 14
  • 32
1
vote
1 answer

CakePHP 3: Caching database object in component

i'm trying to save an database object from the (plugin) component into the CakePHP Cache. This works ( note the toArray() ) $domains = Cache::read('domains', 'long'); if ($domains === false) { $domainsTable =…
Kneecht
  • 93
  • 9
1
vote
0 answers

Crypt and decrypt cakephp 3 Security component

What is wrong on this code in CakePHP 3? crypt function is ok, but when I am trying to decrypt password, it returns false. public function beforeSave($event){ if(isset($event->data['entity']["password"])){ …
Martin Hrabal
  • 102
  • 1
  • 2
  • 10
1
vote
1 answer

CakePHP 3: Paginator sort by languages (with i18n translate behavior)

I have a table with all entries including all translations in multiple languages: How can I create pagination sort links on translated fields? (Cake 3.1.6) Summary: This is not working, I can't sort by the translations this…
Oops D'oh
  • 941
  • 1
  • 15
  • 34
1
vote
1 answer

CakePHP 3: Plugin routing without a slash at the end?

Admin plugin / PagesController methods: home index add .. removed default display method. Problem, i can't access url without slash at end mysite.com/admin/pages , if i try get redirect to mysite.com/admin/webroot/pages and error message Error:…
Salines
  • 5,674
  • 3
  • 25
  • 50
1
vote
1 answer

How do I convert validation rules from CakePHP 2.x to 3.x?

I am upgrading my cakephp code from 2.6.7 to 3.1.5. The old version code works fine: public $validate = array( 'email' => array( 'rule' => 'isUnique', 'required' => true, 'message' => 'Email already…
Abdus Sattar Bhuiyan
  • 3,016
  • 4
  • 38
  • 72
1
vote
1 answer

CakePHP 3: How to create custom model callbacks?

Need good start point to create custom model callbacks. For specific part of application i can't use default cakephp lifecycle callbacks (beforeSave, afterSave,..) because table is large. In controller I create more methods wich partial update…
Salines
  • 5,674
  • 3
  • 25
  • 50
1
vote
2 answers

How to add associated data while adding User simultaneously CakePHP 3.x?

I would like to be able to add a membership record at the same time I add a user. I can't seem to get it to work. I want to be able to select the membership level and have that data get sent to the controller where I can add the data, unless there…
Battousai
  • 503
  • 7
  • 17
1
vote
3 answers

How to check CSRF token using AJAX and CakePHP 3 when user is not logged in?

So I made my site live and I am entering into the public realm where people aren't always nice. I just started learning about CSRF and saw that it was something I needed when I made my cakephp 3 site live. As seen here! I added the csrf component…
Battousai
  • 503
  • 7
  • 17