Skip to content

Instantly share code, notes, and snippets.

@mcfdn
mcfdn / view.phtml
Created October 23, 2012 16:08
Jquery File Upload Partial
<form id="<?php echo $this->escape($this->form->getAttrib('id')); ?>" action="<?php echo $this->escape($this->form->getAction()); ?>" method="<?php echo $this->form->getMethod(); ?>">
<div class="fileupload-buttonbar">
<span class="fileinput-button">
<span>Add files...</span>
<?php echo $this->form->Photo; ?>
</span>
<?php echo $this->form->Start; ?>
<?php echo $this->form->Cancel; ?>
<?php echo $this->form->Delete; ?>
<div class="fileupload-progress fade">
@mcfdn
mcfdn / App_Validate_Xml.php
Created October 9, 2012 12:05
Validate XML With Zend_Form
<?php
class App_Validate_Xml extends Zend_Validate_Abstract
{
const ERROR_MESSAGE = 'error';
public $xmlError;
protected $_messageVariables = array(
'xmlError' => 'xmlError'
);
@mcfdn
mcfdn / PluralHelper.php
Created October 7, 2012 14:30
Manage Singular and Plural Words
<?php
/**
* @author James McFadden <[email protected]>
*/
final class PluralHelper
{
private static $irregularPluralForms = array(
'alumnus' => 'alumni',
'analysis' => 'analyses',
'appendix' => 'appendices',