MainelyDesign.com Blog

Showing articles 81 - 90 (147 total)

Create a Checklist Group or Related Checkboxes in CakePHP

Posted on 03/05/2010 at 12:38 pm | Viewed 43,773 times | 1 comment

This is an interesting one.  I needed to create a group of checkboxes.  In my mind, it's just like a radio button group, except with checkboxes.  The only difference should be that with radio buttons you can only select one, while with a checkbox group you should be able to select as many as you want.  To achieve a checklist group in CakePHP is...

Export to PDF from Microsoft Publisher

Posted on 03/05/2010 at 10:54 am | Viewed 12,373 times | 0 comments

I have a client that sends me newsletters in Microsoft Publisher format.  I wanted to output the newsletter as a PDF, but wanted to keep the text for SEO and so users can copy and paste the text if needed.  Microsoft Publisher doesn't have an export to PDF function, so usually I would just do a File > Print and select Adobe PDF as the printer. ...

Which Submit Button was Clicked in CakePHP? Use Name.

Posted on 03/04/2010 at 12:01 pm | Viewed 26,199 times | 2 comments

If you want to have multiple submit buttons that make a form do different things there's a simple way to do this.  The name of the submit button that was clicked by the user will be sent (via POST) with all the other POSTed data.  This is very handy if you want to have a cancel button and continue button. In CakePHP the name of the button won't...

PHP Break Out of All Foreach or While Loops

Posted on 02/25/2010 at 02:44 pm | Viewed 23,481 times | 0 comments

Let's have some fun with PHP's break command... I didn't think it was possible.  I just learned (I've been programming PHP for like 7 years) that you can instruct break how many levels of nesting to break out of!  I'm not surprised that break in PHP allows you to specify the number of loops (or switch statements) to break out of, but I am...

Changing the Order Sequence of CakePHP Behaviors

Posted on 02/25/2010 at 07:20 am | Viewed 13,303 times | 0 comments

For reasons too long to explain in this post, I have two behaviors that are run on the same pieces of data (a translate behavior and a settings import/export behavior).  One behavior is attached to the model using var $actsAs, while the other behavior is attached dynamically, during runtime using $this->attachBehavior();.  I needed the...

Getting a List of Database Tables in CakePHP

Posted on 02/23/2010 at 12:22 pm | Viewed 18,569 times | 1 comment

I ran into an interesting problem today.  What I wanted to do was know if a table didn't exist in my CakePHP application.  What happens- a cakeError is thrown everytime a database table doesn't exist.  This is really annoying...I think it would be beneficial to be able to tell Controller::loadModel() to return false instead of an error...

Best CSS Method for Using Image as Submit Button

Posted on 02/03/2010 at 12:17 pm | Viewed 21,623 times | 2 comments

I came across an interesting issue with web forms and CSS.  Surprisingly, the end result is much better than I expected.  I knew that using an image instead of a traditional form submit button (<input type="submit">; instead of <input type="image"> or <input type="button">) would be a little challenging.  I like a challenge, plus I wanted to...

Weird Git Error After Upgrade: Repository not found. Make sure you include the .git

Posted on 02/02/2010 at 08:18 am | Viewed 16,134 times | 0 comments

This isn't a weird error in that I've never seen it (ususally when I forget to load up Pagaent before attempting Github push/pulls).  It's weird because everything was working perfectly and then I couldn't do anything from remote!  I upgraded msysgit recently and hadn't tried to do any remote commands until yesterday.  And I kept getting the...

Using Git and Plink for SSH on Windows

Posted on 01/25/2010 at 11:11 am | Viewed 39,040 times | 0 comments

Well, I finally had an opportunity to install Git on Windows yet again.  It had been quite a while since my last time installing Git on Windows, so I was a little rusty and couldn't figure out how to get Git to use Plink for SSH.  It's actually quite simple and dependent on a Windows system variable. Getting Git to use Plink for SSH on Windows...

Using Jquery for target="_blank" and strict xHTML

Posted on 12/28/2009 at 03:27 pm | Viewed 15,377 times | 0 comments

If you like to see the little green check mark that HTML Validator shows when your HTML is 100% valid, you'll love this little trick. Thanks to badlydrawntoy.com .  Target="_blank" Breaks xHTML Strict Guidelines When you include the target attribute, your HTML will break the standards guideline for xHTML strict.  If you are using this...

    5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13   

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design