Welcome to MainelyDesign.com

Photos of Rockland, Maine. Summer 2009.

A blog mostly about web design

This is the personal blog of Kevin Wentworth.  Topics covered here are web programming, design and internet marketing.

Change Order of Loaded Behaviors in CakePHP 3

Posted on 09/14/2018 at 09:33 amViewed 190 times

Turns out it's really easy to change the order of how behaviors are loaded in CakePHP 3.  Wait, I'm actually sort of lying.  You can't change the order of loaded behaviors. (BOO!).  In previous versions of Cake this was a problem... however, with the fully implemented Events subsystem in Cake3, all you need to do is change the priority of the...

CakePHP 3 - Accept JSON Header Only Working When Debug False

Posted on 05/29/2018 at 09:20 amViewed 728 times

Strange thing... when you have debug disabled you may find that your application works fine when dealing with json routes without the extension.  Instead of accessing /posts.json, you would access /posts and send an Accept: application/json header and the same thing is achieved. Debug On - Json View Templates Don't Load - Same Accept Header I...

Remove All Events from Google Calendar (Reset Calendar)

Posted on 05/23/2018 at 09:29 pmViewed 756 times

I've been doing a lot of programming with the Google Calendar API lately and ran into an issue when I was ready to "go live" with the site.  The Google Calendar was loaded with tons of test data!  I searched around and found plenty of sites giving the same answer.  The problem with the answer- it was incomplete.  If you want to reset a calendar...

Google Tag Manager (GTM) Not Firing Default PageView Event

Posted on 11/08/2017 at 12:21 pmViewed 1,669 times

We had an interesting issue here today regarding Google Tag Manager not firing the default PageView event.  Instead it was firing the /gtm.js event.  WTF?! Turns out, the system we were using was reading event: 'gtm.js'  in the GTM container snippet as a link to a javascript resource.  So, it was turning the "url" into an absolute path, like...

In PHP, how do you get __toString() Magic Method Result without calling echo?

Posted on 10/13/2017 at 01:49 pmViewed 1,368 times

I knew this answer at one point, then forgot it.  So, here it is for memory's sake... How can you get __toString() Magic Method Output WITHOUT using echo statement? $echoed = strval($object->property); Cheers, - Kevin Wentworth

Read More Posts.

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design