Skip to content

Commit dce8aed

Browse files
committed
Form Validation Helper.
1 parent 7d7a091 commit dce8aed

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

helpers/form_validation_helper.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
defined('BASEPATH') OR exit('No direct script access allowed');
3+
4+
if (!function_exists('rule_group')) {
5+
function rule_group(string $group):array
6+
{
7+
if (!file_exists(APPPATH."validations/$group.php")) {
8+
throw new Exception("Validation rule group file $group.php does not exist.");
9+
}
10+
11+
include APPPATH . "validations/$group.php";
12+
13+
return $config;
14+
}
15+
}

libraries/Platform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ function __construct()
4545
});
4646

4747
get_instance()->load->splint(self::PACKAGE, '%platform');
48+
get_instance()->load->splint(self::PACKAGE, '%form_validation');
4849
}
4950
/**
5051
* [getInstalledPackages List out all currently installed packages within the

0 commit comments

Comments
 (0)