Jump to content

How to call a function from custom model?

custom model set_model

  • Please log in to reply
2 replies to this topic

#1 Qarlo



  • Members
  • Pip
  • 6 posts

Posted 10 November 2017 - 01:44 PM


I was trying to set up a custom model.


I followed the example from the set_model documentation page:



In the example a function called "get_relation_n_n_unselected_array" is defined. What I find strange is that this function never gets called.


So in my code I tried the following:

public function edit_photo()
$this->view = false;

$crud = new grocery_CRUD();

class My_Custom_model extends grocery_CRUD_Model {

    function my_function()
        echo 'test';

I made sure that the custom model is inside the models directory.


I get an error that my_function is undefined.


What am I doing wrong?


#2 caramayson



  • Members
  • Pip
  • 1 posts

Posted 17 August 2018 - 10:11 AM

When you characterize the parameters, you have the alternative of simply writing in the parameter name or giving them a default esteem. You'll see the greater part of the parameters are compared to some esteem. These are their default esteems.

#3 mp3man



  • Members
  • Pip
  • 2 posts

Posted 17 July 2019 - 04:50 PM

Just replace your call...


by this one:


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users