CakePHP: Validate dependent field (select dropdown + input field)

Posted July 15th, 2010 in CakePHP, PHP, Programming, Projects by Louie Miranda

Earlier this week, I was working on a project where I needed to validate two dependent fields.

< ?php echo input('office', array('type' => 'select', 'options' => $nd[0])); ?>
< ?php echo input('office_other', array('maxlength' => '255', 'size' => '35', 'label' => 'Other Office')); ?>

The “office” field is a select (drop down box) from my data array(). What I needed is to be able to add another data from a field and name it as “office_other” where it would initially capture and re-list again new offices if it does not exist.

Continue Reading »

Two of my favorite Eclipse Plugins

Posted April 16th, 2010 in PHP, Programming, Technology by Louie Miranda

Just want to share my two favorite Eclipse Plugin.

  1. AnyEdit tools plugin for Eclipse
  2. FileSync plugin for Eclipse

All made by Andrei Loskutov

Continue Reading »

A code to deeply remove multiple quote’s (\\\\’) and make it just a single quote ‘ and so on

Posted April 15th, 2010 in PHP, Programming by Louie Miranda

The PHP string function “stripslashes” only remove’s a certain “\” on a string. Here’s a good code I found to deeply remove multiple \\\\\ on a string.

Continue Reading »

PHP Adding leading zero's

Posted August 11th, 2009 in PHP, Programming by Louie Miranda

My additional notes.

1
2
sprintf("%02d",$data['arraydate']['F']))
sprintf or str_pad

Switched to Netbeans from Eclipse IDE

Posted March 10th, 2009 in Programming by Louie Miranda

I’ve heard a lot of good things about Netbeans on the CakePHP mailing list just recently (latest one) and I finally decided to give it a try. The basic things I am looking for is SVN, color coded code structure, ftp support and so on — and easy to update.

So far, Netbeans has it. For now, I am saying goodbye to Eclipse and will be switching to Netbeans!

The benefits of SOAP

Posted March 2nd, 2009 in Programming by Louie Miranda

I just recently got interested on SOAP. This will make a huge improvement on how I scale my applications using PHP and ASP.NET.

Thanks for the article from Jimmy (trackback).

WOW! Nine-year-old writes iPhone code

Posted February 10th, 2009 in News by Louie Miranda

Yes, you got it right! :)

A nine-year-old Malaysian boy in Singapore has written a painting application for the Apple iPhone.

Lim Ding Wen created the finger painting program, known as Doodle Kids, for his two younger sisters aged three and five.

The program allows iPhone owners to draw images on the handset’s touch screen using just their fingers.

The program has been downloaded more than 4,000 times from Apple’s iTunes store in less than two weeks. Continue Reading »

Attaching a file on CakePHP!

Posted December 5th, 2008 in PHP, Programming by Louie Miranda

This is how I attached a file on CakePHP!

$this->Email->filePaths = array(‘/www/axishift/app/webroot/files/’);
$this->Email->attachments = array(‘attachment.txt’);

Limit feeds on simplepie using cakephp 1.2.x

Posted November 12th, 2008 in PHP, Programming, Projects by Louie Miranda

I am currently working on Simplepie and CakePHP 1.2.x. I have a working code that successfully display xml feeds from different remote sources, a sample can be viewed on my homepage. And, I can’t find how to limit it.

Continue Reading »

Three alternating css class using PHP

Posted July 29th, 2008 in CSS, Programming by Louie Miranda

My code for three alternating class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<div class=row_0>content here</div>
<div class=row_1>content here</div>
<div class=row_3>content here</div>
 
    <?php
    $i=0;
    foreach ($row as $data)
    {
    $i+1;
    $row_class = ($i % 3);
    //tpl class
    echo 'class=row_'.$row_class;
    }
    ?>

HTH