This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function configure() | |
{ | |
$this->setWidgets( array( | |
'email' => new sfWidgetFormInputText() | |
'confirm_email' => new sfWidgetFormInputText() | |
)); | |
$this->setValidators(array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function validateConfirmEmail( $validator, $values ){ | |
if($values['email']&&$values['email']!=$values['confirm_email']) | |
{ | |
throw new sfValidatorError($validator, 'Please confirm your email, currently they do not match!.'); | |
} | |
return $values; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$databaseManager = sfContext::getInstance()->getDatabaseManager(); | |
$manager=Doctrine_Manager::getInstance(); | |
$newConn = new sfDoctrineDatabase(array('dsn'=>'XXX','name'=> 'ExampleName')); | |
$newConn->connect(); | |
$databaseManager->setDatabase('ExampleName',$newConn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$databaseManager = sfContext::getInstance()->getDatabaseManager(); | |
$manager=Doctrine_Manager::getInstance(); | |
// If the Doctrine Manager has the connection already close it so the new connection can be established | |
if($manager->contains('ExampleName')) | |
$manager->closeConnection($manager->getConnection('ExampleName')); | |
$newConn = new sfDoctrineDatabase(array('dsn'=>'XXX','name'=> 'ExampleName')); | |
$newConn->connect(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class sfWidgetFormInputiPhoneCheckbox extends sfWidgetFormInputCheckbox { | |
public function __construct($options = array(), $attributes = array()) | |
{ | |
$this->addOption('checked_label'); | |
$this->addOption('un_checked_label'); | |
parent::__construct($options, $attributes); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$xml = simplexml_load_file( "http://feeds.foursquare.com/history/myurl.kml" ); | |
$arr["a"] = $xml->Folder; | |
$xml = simplexml_load_file( "http://feeds.foursquare.com/history/ackleysurl.kml" ); | |
$arr["m"] = $xml->Folder; | |
echo json_encode( $arr ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.getJSON( "location.php", {}, function(data){ | |
data.a.Placemark = data.a.Placemark.reverse(); | |
var hasStarted = false; | |
var barIndex = 1; | |
$.each( data.a.Placemark, function(i, val){ | |
if( val.published.indexOf("Sat, 11") == -1 ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function getDoctrineEvents() | |
{ | |
$databaseManager = sfContext::getInstance()->getDatabaseManager(); | |
$events = array(); | |
if ($databaseManager) | |
{ | |
foreach ($databaseManager->getNames() as $name) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$databaseManager = sfContext::getInstance()->getDatabaseManager(); | |
$newConn=new sfDoctrineDatabase(array('name'=>'NewConnectionName','dsn'=>$databaseString)); | |
$newConn->connect(); | |
$databaseManager->setDatabase('NewConnectionName',$newConn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" id="someForm" method="GET" onsubmit="saysomething(); return false"> | |
...form.. | |
</form> | |
<script type="text/javascript"> | |
function saysomething(){ | |
alert("Hello world from saysomething()"); | |
} |