报错信息
<code>Catchable fatal error: Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\PresenceOf given in C:\wamp\www\test\apps\models\Robots.php on line 49</code>
model中的验证代码
<code>use Phalcon\Mvc\Model\Validator\PresenceOf;
use Phalcon\Mvc\Model\Validator\Uniqueness;
public function validation()
{
$this->validate(
new PresenceOf(
array(
"field" => "name",
"message" => self::NAME_NOT_EMPTY
)
)
);
$this->validate(
new Uniqueness(
array(
'field' => 'code',
'message' => self::ERR_CODE_NOT_UNID
)
)
);
if ($this->validationHasFailed() == true) {
return false;
}
return true;
}</code>报错信息
<code>Catchable fatal error: Argument 1 passed to Phalcon\Mvc\Model::validate() must implement interface Phalcon\ValidationInterface, instance of Phalcon\Mvc\Model\Validator\PresenceOf given in C:\wamp\www\test\apps\models\Robots.php on line 49</code>
model中的验证代码
<code>use Phalcon\Mvc\Model\Validator\PresenceOf;
use Phalcon\Mvc\Model\Validator\Uniqueness;
public function validation()
{
$this->validate(
new PresenceOf(
array(
"field" => "name",
"message" => self::NAME_NOT_EMPTY
)
)
);
$this->validate(
new Uniqueness(
array(
'field' => 'code',
'message' => self::ERR_CODE_NOT_UNID
)
)
);
if ($this->validationHasFailed() == true) {
return false;
}
return true;
}</code>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号