コード例 #1
0
ファイル: Email.php プロジェクト: norbe/framework
	protected function setup()
	{
		parent::setup();

		$this->addPassword('current', "Current password")->setRequired();
		$this->addEmail('email', "E-mail")->setRequired();

		$this->addSubmit('sub', "Save");

		$this->onSuccess[] = callback($this, 'process');
	}
コード例 #2
0
ファイル: AddUser.php プロジェクト: norbe/framework
	protected function setup()
	{
		parent::setup();

		$roles = $this->getDoctrineContainer()->getService('Nella\Security\RoleEntity')->repository->fetchPairs('id', "name");

		$this->addText('username', "Username")->setRequired();
		$this->addEmail('email', "E-mail")->setRequired();
		$this->addPassword('password', "Password");
		$this->addPassword('password2', "Re-Password")->addCondition(static::FILLED)
			->addRule(static::EQUAL, NULL, $this['password']);
		$this->addSelect('role', "Role", $roles);
		$this->addSelect('lang', "Lang", array('en' => "English"))->setRequired(); // @todo

		$this->addSubmit('sub', "Add");

		$this->onSuccess[] = callback($this, 'process');
	}