Skip to content

Instantly share code, notes, and snippets.

View khepin's full-sized avatar

Sebastien Armand khepin

  • San Francisco, USA
View GitHub Profile
/*
Le browser ne trigger aucun "blur" tant que la fenêtre du browser n'est pas active.
Ca peut se vérifier via un simple script dans ta console que tu laisses tourner avec un compteur de "blur"
Du coup on s'était résiliés à une fonction helper qui injecte du JS dans la page et
déclenche manuellement le "blur"
*/
function blurElement(selector) {
element(by.css(selector)).sendKeys(protractor.Key.TAB); // Element cannot have focus.
if (!function_exists('debuglog')) {
function debuglog($message) {
if (!is_string($message)) {
$message = print_r($message, true);
}
$message .= "\n";
$dir = ROOT . '/../logs/';
if (!is_dir($dir)) {
mkdir($dir);
}
$('#booking_end_date_jquery_control').datepicker(
'option',
'onSelect',
function(date) {
// keep the original symfony function to update day / month / year select boxes
wfd_booking_end_date_update_linked(date);
// our own stuff
alert('haha');
});
# You can find more information about this file on the symfony website:
# http://www.symfony-project.org/reference/1_4/en/10-Routing
<?php foreach(glob(dirname(__FILE__).'/routing/*.yml') as $filename):?>
<?php include($filename)?>
# Note that this empty line is important.
# If not present you have to make all your other
# routing files end with an empty line in order to prevent indentation errors
<?php endforeach?>
.routes_for_module_a:
design:
class: sfDoctrineRouteCollection
options:
model: Design
actions: [show]
.routes_for_module_b:
...
<?php
class MyExcel {
private static $format = '';
public static function setFormat(sfEvent $event) {
self::$format = $event['format'];
}
public static function setContent(sfEvent $event, $response) {
all:
...
request:
param:
formats:
xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
exceltest:
url: /a/test.:sf_format
param: { module: excel, action: index }
...
<Worksheet ss:Name="Sheet1">
<Table>
<Row>
<Cell><Data ss:Type="String">Name</Data></Cell>
<Cell><Data ss:Type="String">Company</Data></Cell>
<Cell><Data ss:Type="String">Phone</Data></Cell>
<Cell><Data ss:Type="String">Mobile</Data></Cell>
<Cell><Data ss:Type="String">Gender</Data></Cell>
<Cell><Data ss:Type="String">Duty</Data></Cell>
<?php
require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();
class ProjectConfiguration extends sfProjectConfiguration
{
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');