Commit 05dcc083 by 庄欣

后台开发版本

parent 36a62fdb
...@@ -8,6 +8,7 @@ $loader->registerDirs([ ...@@ -8,6 +8,7 @@ $loader->registerDirs([
$loader->registerNamespaces( $loader->registerNamespaces(
[ [
'lib' => $config->application->library, 'lib' => $config->application->library,
'config' => './app/config' 'config' => './app/config',
'validattion' => './app/validation'
] ]
)->register(); )->register();
\ No newline at end of file
<?php
namespace validattion;
use Phalcon\Validation;
use Phalcon\Validation\Validator\StringLength;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Between;
//相册验证
class WorksValidation extends Validation
{
public function initialize()
{
//相册名称
$this->add("title", new PresenceOf([
'message' => '请填写套系名称'
]));
$this->add('title', new StringLength([
'max' => 15,
'min' => 2,
'messageMaximum' => '套系名称必须15字以下',
'messageMinimum' => '套系名称2个字以上'
]));
//图片
$this->add("cover", new PresenceOf([
'message' => '请选择封面'
]));
//价格
$this->add("price", new PresenceOf([
'message' => '请填写套系价格'
]));
$this->add("price", new Between([
'minimum' => 1,
'maximum' => 100000,
'message' => '价格须在1元以上,100,000以下'
]));
//使用积分
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment