Skip to content

Instantly share code, notes, and snippets.

@goosys
Created December 25, 2014 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goosys/88165c3ca0d2538c293f to your computer and use it in GitHub Desktop.
Save goosys/88165c3ca0d2538c293f to your computer and use it in GitHub Desktop.
FuelPHPでアップロードファイルをバリデーション
<?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