Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php namespace Config;
- class Validation
- {
- //--------------------------------------------------------------------
- // Setup
- //--------------------------------------------------------------------
- /**
- * Stores the classes that contain the
- * rules that are available.
- *
- * @var array
- */
- public $ruleSets = [
- \CodeIgniter\Validation\Rules::class,
- \CodeIgniter\Validation\FormatRules::class,
- \CodeIgniter\Validation\FileRules::class,
- \CodeIgniter\Validation\CreditCardRules::class,
- ];
- /**
- * Specifies the views that are used to display the
- * errors.
- *
- * @var array
- */
- public $templates = [
- 'list' => 'CodeIgniter\Validation\Views\list',
- 'single' => 'CodeIgniter\Validation\Views\single',
- ];
- //--------------------------------------------------------------------
- // Rules
- //--------------------------------------------------------------------
- public $jurusan = [
- 'jurusan' => 'required|string',
- 'kapasitas' => 'permit_empty|integer',
- 'terisi' => 'permit_empty|integer|less_than_equal_to[{kapasitas}]'
- ];
- public $jurusan_errors = [
- 'jurusan' => [
- 'required' => 'Jurusan Wajid diisi',
- 'string' => 'Jurusan hanya dapat diisi string',
- ],
- 'kapasitas' => [
- 'integer' => 'Kapasitas hanya dapat diisi Angka',
- ],
- 'terisi' => [
- 'integer' => 'Terisi hanya dapat diisi Angka',
- 'less_than_equal_to' => 'Terisi harus kurang dari atau sama dengan Kapasitas',
- ],
- ];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement