Skip to content

Instantly share code, notes, and snippets.

View malteo's full-sized avatar
🏠
Working from home

Matteo Giordano malteo

🏠
Working from home
View GitHub Profile
@malteo
malteo / sfWidgetFormSchemaFormatterBootstrap.class.php
Created November 11, 2011 09:21
Symfony form formatter to use with Twitter Bootstrap CSS
<?php
/**
* A FormSchemaFormatter to use with Twitter Bootstrap CSS.
*
* @author malteo
*/
class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter
{
protected
@malteo
malteo / gist:1264387
Created October 5, 2011 13:12
How to use Monolog in any PHP file
<?php
spl_autoload_register(function ($class) {
$file = $__DIR__.'/relative/path/to/Monolog/src/'.strtr($class, '\\', '/').'.php';
if (file_exists($file)) {
require $file;
return true;
}
});
@malteo
malteo / gist:623753
Created October 13, 2010 09:42
Allowing Users To Invoke Methods Before A Component Is Rendered in ExtJS
/**
* Allowing Users To Invoke Methods Before A Component Is Rendered
*
* @see http://www.sencha.com/blog/2010/08/27/tips-and-tricks-for-ext-js-component-developers/
*/
someMethod: function() {
if (!this.rendered) {
this.on('render', this.someMethod, this, {single: true});
return;