Welcome to My Blog

IT related tech tips since 2006

Login

Blog History

CakePHP 3: Ain’t gonna GET if it ain’t gotta GET

Just installed CakePHP3 under nginx and tried to switch between pages of a paginated view and every time it would return the default 1st page. The url for each page was http://example.com/cake3/posts?page=2 Discovered using debug_kit that the GET request QUERY_STRING...

CakePHP 3: _serialize is a View Killer

Note to self: If $this->set('_serialize', [ 'content' ]);  then a request for content type of 'application/json' or 'application/xml' will automagically return the correct data without needing a view file. But if $this->set('_serialize', false); isn't set then a...

DebugKit not Loading Toolbar in CakePHP 3

Problem: debug set to true in config/app.php, vendor/cakephp/debug_kit exists but debug kit toolbar not appearing in browser, debug_kit/js/toolbar.js shows a 404 when viewing page load in Developer Tools in browser. Cause: symlink from vendor/cakephp/debug_kit/webroot...

CakePHP 3 AJAX Modelless & Database backed Forms

Standing on the shoulders of giants. I have converted the code from the below mentioned sites to work with CakePHP 3. Normal database backed Form with AJAX JQuery code Inspired by: http://jamnite.blogspot.com.au/2009/05/cakephp-form-validation-with-ajax-using.html...

Globally Change Date Display in CakePHP 3

By default the Locale for CakePHP 3 is en_US so dates display as m/d/y # config/app.php 'App' => [ 'namespace' => 'App', 'encoding' => env('APP_ENCODING', 'UTF-8'), 'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'), 'base' => false, Which makes...