Skip to content

Instantly share code, notes, and snippets.

View 77web's full-sized avatar

Hiromi Hishida 77web

  • linkage-inc
  • Nagoya, Aichi, Japan
  • X @77web
View GitHub Profile
@77web
77web / sfWidgetFormDoctrineHierSelect.class.php
Created December 16, 2011 05:34
sfWidgetFormDoctrineHierSelect(jquery)
<?php
/**
* sfWidgetFormDoctrineHierSelect represents a hierarchical selects with jquery help.
*
* @auther Hiromi Hishida<[email protected]>
*/
class sfWidgetFormDoctrineHierSelect extends sfWidgetForm
{
/**
@77web
77web / schema.yml
Created December 18, 2011 23:59
SymfonyAdventCalendarJP2011用schema.ymlのサンプル(sf1.4+doctrine1.x)
Product:
columns:
id:
type: serial
primary: true
name:
type: string(255)
notnull: true
price:
type: integer
@77web
77web / schema.yml
Created December 19, 2011 00:03
SymfonyAdventCalendarJP2011用schema.ymlのサンプル(sf1.4+doctrine1.x)-2
Product:
columns:
id:
type: serial
primary: true
name:
type: string(255)
notnull: true
price:
type: integer
@77web
77web / 1324252920_version1.php
Created December 19, 2011 00:05
SymfonyAdventCalendarJP2011用migrationクラスのサンプル(sf1.4+doctrine1.x)
<?php
/**
* This class has been auto-generated by the Doctrine ORM Framework
*/
class Version1 extends Doctrine_Migration_Base
{
public function up()
{
$this->addColumn('product', 'description', 'string', '', array(
));
@77web
77web / schema.yml
Created December 19, 2011 00:37
SymfonyAdventCalendarJP2011用schema.ymlのサンプル(sf1.4+doctrine1.x)-3
Product:
columns:
id:
type: serial
primary: true
name:
type: string(255)
notnull: true
price:
type: integer
@77web
77web / 1324255002_version2.php
Created December 19, 2011 00:45
SymfonyAdventCalendarJP2011用migrationクラスのサンプル(sf1.4+doctrine1.x)-2
<?php
/**
* This class has been auto-generated by the Doctrine ORM Framework
*/
class Version2 extends Doctrine_Migration_Base
{
public function up()
{
$this->addColumn('product', 'memo', 'string', '', array(
));
@77web
77web / 004_import_navi_menu.yml
Created December 26, 2011 23:59
PNE3.xのglobal,localナビを現在のmixiに合わせるfixture(data/fixtures/004_import_navi_menu.ymlに上書きしてからinstall)
Navigation:
secure_global_navigation_home:
type: "secure_global"
uri: "@homepage"
sort_order: 0
Translation:
ja_JP:
caption: "ホーム"
en:
caption: "Home"
@77web
77web / sfWidgetFormInputTel.class.php
Created April 11, 2012 03:23
Japanese phone number input widget for symfony1.4
<?php
/**
* sfWidgetFormInputTel
*
* @auther 77web<[email protected]>
*/
class sfWidgetFormInputTel extends sfWidgetForm
{
protected $widgets = array();
@77web
77web / the_best_way_for_functional_test.php
Created July 30, 2012 10:31
機能テストの書き方について。
<?php
// modules/foo/actions/actions.class.php
class fooActions extends sfActions
{
public function executeBar(sfWebRequest $request)
{
//何かの計算や条件判定
$this->showNameInTitle = true;
$this->name = 'my name';
}
@77web
77web / sfWidgetFormSchemaFormatterBootstrap.class.php
Created October 19, 2012 09:44
twitter bootstrapのHTMLを出すためのsfForm用formatter
<?php
/**
* sfFormのフォームでtwitter bootstrap用のHTMLを出力するformatterクラス
*
* @auther Hiromi Hishida<[email protected]>
*/
class sfWidgetFormSchemaFormatterBootstrap extends sfWidgetFormSchemaFormatter
{
protected $rowFormat = '<fieldset class="%status%"><div class="control-group">%label%<div class="controls">%error%%field%%help%%hidden_fields%</div></div></fieldset>';
protected $errorRowFormat = '%errors%';