我用這個驗證碼在的actions.class.php驗證輸入,symfony框架
$name = $this->getRequestParameter('title');
if (!$name)
{
$this->getRequest()->setError('The name field cannot be left blank');
return false;
}
但是遇到這樣的錯誤
You must set "compat_10" to true if you want to use this method which is deprecated.
在錯誤日誌。得到這個錯誤之後,我設置了compat_10
到true
在settings.yml,但仍然得到相同的錯誤。
你不使用表單框架嗎?你可以使用它在表單字段上設置驗證器。 – terrid25 2011-04-21 12:09:15