Welcome Guest, Not a member yet? Register   Sign In
allowedFields in class
#3

CodeIgniter 3 didn't really have a model, it only contained the following:

PHP Code:
class CI_Model {

    
/**
     * Class constructor
     *
     * @link    https://github.com/bcit-ci/CodeIgniter/issues/5332
     * @return    void
     */
    
public function __construct() {}

    
/**
     * __get magic
     *
     * Allows models to access CI's loaded classes using the same
     * syntax as controllers.
     *
     * @param    string    $key
     */
    
public function __get($key)
    {
        
// Debugging note:
        //    If you're here because you're getting an error message
        //    saying 'Undefined Property: system/core/Model.php', it's
        //    most likely a typo in your model code.
        
return get_instance()->$key;
    }



If you wan't the "not a model approach" you can simply use Manual Model Creation.

You can however turn that feature off if you like:
https://codeigniter.com/user_guide/model...ing-fields

PHP Code:
$model->protect(false)
      ->
insert($data)
      ->
protect(true); 
Reply


Messages In This Thread
allowedFields in class - by pws - 05-20-2020, 09:48 AM
RE: allowedFields in class - by wdeda - 05-20-2020, 12:20 PM
RE: allowedFields in class - by jreklund - 05-21-2020, 02:47 AM
RE: allowedFields in class - by wdeda - 05-21-2020, 05:44 AM
RE: allowedFields in class - by jreklund - 05-21-2020, 07:42 AM
RE: allowedFields in class - by wdeda - 05-21-2020, 04:12 PM
RE: allowedFields in class - by jreklund - 05-23-2020, 02:40 AM
RE: allowedFields in class - by wdeda - 05-23-2020, 08:42 PM
RE: allowedFields in class - by pws - 06-05-2020, 08:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB