Created
December 25, 2014 16:33
-
-
Save goosys/88165c3ca0d2538c293f to your computer and use it in GitHub Desktop.
FuelPHPでアップロードファイルをバリデーション
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* 独自バリデーションを追加 | |
*/ | |
class Validation_Asset | |
{ | |
/** | |
* アップロードファイルをチェック | |
*/ | |
public static function _validation_upload($val, $config = null) | |
{ | |
Upload::process($config); | |
if( Upload::is_valid() ){ | |
Upload::save(); | |
return true; | |
} | |
return false; | |
//return Upload::get_error(); //TODO send error message | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment