Skip to content

Instantly share code, notes, and snippets.

View EuphoryX1's full-sized avatar

TAKANO,Noriyuki EuphoryX1

  • Tokyo,JAPAN
View GitHub Profile
#!/bin/bash
while getopts a:bc: flag; do
case $flag in
a)
opt_a=$OPTARG
;;
b)
opt_b=1
;;
@EuphoryX1
EuphoryX1 / Symfony2_simple_resource
Last active December 12, 2015 02:08
translationを使わずメッセージリソースを管理する
1. config.ymlなどでparameters, servicesを定義
2. サービスコンテナを定義
3. コントローラ内でサービスコンテナを取得
4. テンプレートへ渡す
@EuphoryX1
EuphoryX1 / symfony2_validation_callback_constraint
Last active December 12, 2015 02:08 — forked from anonymous/symfony2_validation_callback_constraint
Callback制約を使って2つのフォームプロパティを参照してバリデーションを実施する。Callback制約をどのフォームに適用するかを指定するために、groupsの指定が必要
・validation.ymlに
constraints:
- Callback:
methods: [isEmailConfirmEqual]
groups: [registration]
・フォームエンティティクラスに
public function isEmailConfirmEqual(ExecutionContext $context)
{
if ($this->email != $this->email_confirm) {