Skip to content

Instantly share code, notes, and snippets.

View frankmullenger's full-sized avatar

Frank Mullenger frankmullenger

View GitHub Profile
@frankmullenger
frankmullenger / _config.php
Created March 6, 2012 04:54
Example _config.php settings for SwipeStripe
<?php
/**
* SwipeStripe settings
* ====================================================
*/
//License key
ShopSettings::set_license_key('');
@frankmullenger
frankmullenger / SomeForm.php
Created October 31, 2011 01:29
Form validation messages
<?php
class SomeForm extends Form {
function validate(){
if($this->validator){
$errors = $this->validator->validate();
if($errors){
if(Director::is_ajax() && $this->validator->getJavascriptValidationHandler() == 'prototype') {
FormResponse::status_message(_t('Form.VALIDATIONFAILED', 'Validation failed'), 'bad');