コード例 #1
0
ファイル: AeriaUserMeta.php プロジェクト: caffeinalab/aeria
 public static function register()
 {
     foreach (func_get_args() as $options) {
         if (!is_array($options)) {
             throw new Exception("AeriaUserMeta: Options parameter isn't an array.", 1);
         }
         if (is_array_associative($options)) {
             static::setMeta($options);
         } else {
             foreach ($options as $option) {
                 static::setMeta($option);
             }
         }
     }
 }
コード例 #2
0
ファイル: AeriaForm.php プロジェクト: caffeinalab/aeria
 public static function setFormType($typeArray)
 {
     if (!is_array_associative($typeArray)) {
         throw new Exception("AeriaForm: {$typeArray} parameter isn't an associative array.", 1);
     }
     foreach ($typeArray as $name => $type) {
         if (!is_array_associative($type)) {
             throw new Exception("AeriaForm: {$type} parameter isn't an associative array.", 1);
         }
         if (self::validateArrayKey($type, 'before', false) && is_array($type['before']) && is_array_associative($type['before']) || self::validateArrayKey($type, 'after', false) && is_array($type['after']) && is_array_associative($type['after'])) {
             static::$customType[$name] = $type;
         } else {
             throw new Exception("AeriaForm: {$type} doesn't have an array associative with key before or after.", 1);
         }
     }
 }