public function configure()
{
$this->disableCSRFProtection();
}
{
$this->disableCSRFProtection();
}
Desactivar a protecção CSRF no settings.yml:
.settings:
csrf_secret: false
csrf_secret: false
Aqui fala-se principalmente de tecnologia e aplicações que podem dar jeito para o dia a dia...
$admin_module = $sf_user->getAttributeHolder()->getAll('admin_module');
$filters = $admin_module['page.filters'];
$this->widgetSchema
->getFormFormatter()
->setRowFormat('%label%%field%%help%%hidden_fields%');
%label%
%field%
%error%
%help%
%hidden_fields%
se cmb_a is cheched e cmb_b is checked
então
//acção
senão
//erro!
public function configure()
{
parent::configure();
$this->validatorSchema['my_field'] = new sfValidatorCallback(
array('callback' =>
array($this, 'validateMyField')
)
);
}
public function validateMyField($validator, $value)
{
/* All my action goes here */
$tainted_values = $this->getTaintedValues();
if ($tainted_values['my_field_2'] > 0 && $value != '')
{
return $value;
}
else
{
throw new sfValidatorError($validator, "I guess something goes wrong here!");
}
}