Skip to content

Instantly share code, notes, and snippets.

@mekkoo
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mekkoo/313f6964e1809cc43237 to your computer and use it in GitHub Desktop.
Save mekkoo/313f6964e1809cc43237 to your computer and use it in GitHub Desktop.
”sitetitle"というのが今回追加したいフィールドです。
# Group
group:
edit:
submit: グループの更新
show:
name: グループ名
new:
submit: グループの作成
flash:
updated: グループが更新されました
created: グループが作成されました
deleted: グループが削除されました
# Security
security:
login:
username: "ユーザー名:"
password: "パスワード:"
remember_me: ログイン状態を記憶する
submit: ログイン
# Profile
profile:
show:
username: ユーザー名
email: メールアドレス
edit:
submit: 更新
flash:
updated: プロフィールが更新されました
# Password change
change_password:
submit: パスワードの変更
flash:
success: パスワードが変更されました
# Registration
registration:
check_email: %email% 宛にメールを送信しました。メールに記載された確認 URL にアクセスして、アカウントを有効化してください。
confirmed: %username% さんのアカウントの確認が完了しました。
back: 元のページに戻る
submit: 利用規約に同意して登録
flash:
user_created: ユーザーの作成が完了しました
email:
subject: %username% さん、ようこそ!
message: |
こんにちは %username% さん!
アカウントを有効化するには、次の確認 URL へアクセスしてください %confirmationUrl%
開発チーム
# Password resetting
resetting:
password_already_requested: このユーザーのパスワードは 24 時間以内ですでにリクエストされています。
check_email: %email% 宛にメールを送信しました。メールに記載された確認 URL にアクセスして、アカウントを有効化してください。
request:
invalid_username: '"%username%" というユーザー名またはメールアドレスは存在しません。'
username: "ユーザー名かメールアドレス:"
submit: パスワードのリセット
reset:
submit: パスワードの変更
flash:
success: パスワードのリセットが完了しました
email:
subject: パスワードのリセット
message: |
こんにちは %username% さん!
パスワードをリセットするには、次のリセット URL へアクセスしてください %confirmationUrl%
開発チーム
# Global strings
layout:
logout: ログアウト
login: ログイン
register: 登録
logged_in_as: %username% でログイン中
# Form field labels
form:
group_name: "グループ名:"
username: "ユーザー名"
email: "メールアドレス"
current_password: "現在のパスワード:"
password: "パスワード(8文字以上):"
password_confirmation: "パスワードの再入力:"
new_password: "新しいパスワード:"
new_password_confirmation: "パスワードの再入力:"
sitetitle: "サイトタイトル:"
<?php
namespace Acme\UserBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class RegistrationFormType extends AbstractType
{
public function getParent()
{
return 'fos_user_registration';
}
public function getName()
{
return 'acme_user_registration';
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', 'email', array('label' => 'form.email', 'translation_domain' => 'FOSUserBundle'))
->add('username', null, array('label' => 'form.username', 'translation_domain' => 'FOSUserBundle'))
->add('plainPassword', 'repeated', array(
'type' => 'password',
'options' => array('translation_domain' => 'FOSUserBundle'),
'first_options' => array('label' => 'form.password'),
'second_options' => array('label' => 'form.password_confirmation'),
'invalid_message' => 'fos_user.password.mismatch',
))
->add('sitetitle', null, array('label' => 'form.sitetitle', 'translation_domain' => 'FOSUserBundle'))
->add('captcha', 'captcha', array(
'width' => 180,
'height' => 50,
'length' => 5,
'quality' => 100,
'reload' => true,
'as_url' => true
));
;
}
}
Acme\UserBundle\Entity\User:
type: entity
table: fos_user
id:
id:
type: integer
generator:
strategy: AUTO
sitetitle:
type: string
length: 255
column: sitetitle
<?php
// src/Acme/UserBundle/Entity/User.php
namespace Acme\UserBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="acme_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=255)
*
*/
protected $fname;
/**
* @var string
*
* @ORM\Column(name="sitetitle", type="string", length=255)
*/
protected $sitetitle;
public function __construct()
{
parent::__construct();
// your own logic
}
public function getParent()
{
return 'fos_user_registration';
}
/**
* @return string
*/
public function getSitetitle()
{
return $this->sitetitle;
}
/**
* @return string $sitetitle
*/
public function setSitetitle($sitetitle)
{
return $this->sitetitle;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment