MainelyDesign.com Blog

Showing articles 51 - 60 (146 total)

Integration of Cakephp Internationalization and GIT

Posted on 12/28/2012 at 12:33 pm | Viewed 18,355 times | 0 comments

We have discovered in a recent implementation of Internationalization that GIT can corrupt the POEdit generated *.po and *.mo files. Upon committing updated files GIT by default will replace the LF with CRLF in these files.   These files cannot be tampered with after generation,  even viewing the files with most windows based editor may corrupt...

Smooth Gradients in Photoshop

Posted on 10/24/2012 at 10:16 am | Viewed 10,835 times | 0 comments

Every now and then, when I look really close at a design in Photoshop, I see that one of my color gradient layers looks really bad.  I didn't know what this was called, until I searched around for how to get smooth gradients in Photoshop.  Your Gradient's Worst Enemy: Banding Turns out this lovely effect is called banding .  This makes...

Best Way To Get Transparent PNGs Without Any Hacks

Posted on 10/21/2012 at 10:27 am | Viewed 9,560 times | 0 comments

I avoided PNG images for quite a while, mainly because I could accomplish almost every task with transparent GIFs (if not, I could change the design ever so slightly).  Fast forward a few years and web designs are far too complex and textured to only use transparent GIFs, plus it's so much cooler to say "ping" than "gif".  Another reason I...

CakePHP Form Security Blackhole on Large Forms

Posted on 06/28/2012 at 11:11 am | Viewed 11,452 times | 0 comments

I kept getting the White Screen of Death (WSOD).  What we at Saco Design have appropriately named the behavior of the default blackhole Security Component setting.  The weird issue was that I was getting the issue only on the live server.  I had recently updated the live server's version of PHP to the latest 5.3.x release.  However, I...

Calling an Element from a Helper

Posted on 02/24/2012 at 02:07 pm | Viewed 9,170 times | 0 comments

This one caused me more than a little headache,  turned out it was easily solvable. renderElement() can be used in a helper function. The following example worked nicely for me. In this case I am calling and element "order_form.ctp"   $theView = ClassRegistry::getObject('view'); echo $this->output($theView->renderElement('order_form'));...

Forcing A Single Join in CakePHP Pagination

Posted on 10/14/2011 at 09:25 am | Viewed 18,054 times | 0 comments

The devil's in the details... I was trying to make a really simple, dreadfully easy, database join in my CakePHP web application.  I've forced joins in Cake before, using the 'joins' key in the options array for find calls and paginate calls with no issue.  It was late and for the first time I only wanted to use a single join.  I copied the...

Inserting NOW() into MySQL Using CakePHP

Posted on 08/11/2011 at 11:16 pm | Viewed 11,026 times | 0 comments

Great find.  If you want to insert NOW() into your query using CakePHP's save() or saveAll() functions, you can use the following expression: $this->data['Model']['custom_date_field'] = DboSource::expression('NOW()'); Not sure how it works on MSSQL, but I will be testing that soon. Cheers, -Kevin Wentworth

Best PaginateCount for CakePHP - with Group By Support

Posted on 08/07/2011 at 05:03 pm | Viewed 15,220 times | 0 comments

I'm been muddling my way through pagination with multiple joins, and complex filtering.  I finally got it all working (more on that later, maybe....) when I noticed that I couldn't paginate my results.  Everything was working fine until I added a "group" parameter to the find call.  Instead of getting the right count, I got a count of 1!  A...

CakePHP Error Messages Not Showing on Form

Posted on 04/03/2011 at 12:40 pm | Viewed 16,318 times | 2 comments

I ran into an issue today that I've run into before, except I couldn't remember what I did to fix it (hence this article).  I was using CakePHP validation rules to validate a user account details.  The CakePHP validation was properly failing (the form data wasn't being saved) and I could tell the validate array was set correctly because the...

Sorting Paginated Results Using a Related Model Field in CakePHP

Posted on 02/06/2011 at 10:12 pm | Viewed 14,744 times | 0 comments

Time crunch, so this will be quick.  I didn't want to go hunting for how to sort paginated results in CakePHP using a related model field again.  I actually found my answer on Stack Overflow.  The original poster had it right, so I'm not sure if it was a CakePHP bug or what (I don't have an account or I would correct it... it's on the list of...

    2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10   

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design