MY モデルを使用してコールバック検証を使用する方法を知りたい - Jamie Rumbelow が Modular 拡張機能を使用して作成 - wiredesignz
私はMY_Form_validationを作成し、実行関数を次のように変更しました:
class MY_Form_validation extends CI_Form_validation {
/**
* Stores the CodeIgniter core object.
*
* @access public
*
* @var object
*/
public $CI;
/**
* Constructor
*
* @return void
*/
function __construct($config = array())
{
// Merged super-global $_FILES to $_POST to allow for better file validation inside of Form_validation library
$_POST = (isset($_FILES) && is_array($_FILES) && count($_FILES) > 0) ? array_merge($_POST,$_FILES) : $_POST;
parent::__construct($config);
}
/**
* Performs the actual form validation
*
* @access public
*
* @param string $module Name of the module
* @param string $group Name of the group array containing the rules
*
* @return bool Success or Failure
*/
public function run($module='', $group='')
{
(is_object($module)) AND $this->CI =& $module;
return parent::run($group);
}
コントローラーでコールバックを使用してフォーム検証を実行すると完全に機能しますが、モデル内で実行する方法が不思議で、常にコールバックをスキップします
お時間をいただき、ありがとうございます:)