Skip to content

Instantly share code, notes, and snippets.

View apipkin's full-sized avatar
🤖
^_^

Anthony Pipkin apipkin

🤖
^_^
View GitHub Profile
function setup() {
var myIO = { ... };
myIO.on.success(Y.bind(this.onSuccess,this));
Y.io(myIO.url,myIO);
}
function onSuccess(id,o,args) {...}
var _getConnectValues = function(frm) {
var values = [];
frm.all('input,textarea').each(function(o){
values.push(o.get('name') + '=' + o.get('value'));
});
return values.join('&');
}
/// use...
YUI.add('echofin-modal',function(Y){
var _modal = null
;
Y.Echofin.Modal = {
BUTTON_CANCEL : 'Cancel',
BUTTON_CLOSE : 'Close',
BUTTON_OK : 'Ok',
BUTTON_NO : 'No',
BUTTON_YES : 'Yes',
<?php
class dir
{
protected $d;
public $path;
public function __construct($path) {
$this->path = $path;
$this->d = opendir($path);
<?php
$this->addElement(new Zend_Form_Element_Text('phone_number'));
$this->getElement('phone_number')
->setLabel('Phone Number')
->setRequired(true)
->addValidator('StringLength',false, 10)
->addValidator('Regex',false, array('/^[+]?[-\d() .]*$/i', 'message'=>'Please provide a valid Phone Number.'))
->setErrorMessages(array(''))
;
<?php
// Zend Form Snippet
// custom error message with Regex Validator
$this->addElement(new Zend_Form_Element_Text('phone_number'));
$this->getElement('phone_number')
->setLabel('Phone Number')
->setRequired(true)
updateModalUrl : function(type, value) {
var url = Y.Echofin.Modal.Upload.getUrl();
if(url.indexOf(type) < 0) {
url += '/' + type + '/' + value;
}else{
var start = url.indexOf(type) + type.length + 1;
var end = url.indexOf('/',start);
var build = url.substring(0,start) + value + url.substring(end);
url = build
}
_domready : function() {
ioUpload.method = 'POST';
ioUpload.url = BASE_URL + 'properties/property-images/upload';
ioRefresh.url = BASE_URL + 'properties/property-images/list-refresh';
ioUpload.form = {
id:'uploadImage-form',
upload:true
};
},
<?php
/**
* Echofin_Model_Abstract
*
* @category Echofin
* @package Echofin_Model
*/
abstract class Echofin_Model_Abstract {
<?php
abstract class Echofin_Model_Mapper_Abstract
{
protected $_dbTable;
protected $_dbTableDefault;
protected $_model;
protected $_model_name;