Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Override same default method in joomla component

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 129
    Comment on it

    In some cases we need to manipulate the data a bit before saving it. So there is a function called PrepareTable() in joomla which is declared under file modeladmin.php and it is located under the libraries/joomla/application/component folder and it is invoked from the function save in that same file. PrepareTable() function is called immediately prior to saving the data to the database. It takes the current form as a parameter and inside this function you can do all the data manipulation that you want.

    protected function prepareTable($table)
    {
        $table->fieldname = newvalue;
    }
    

    The above function has to be placed in the model of the form that youre trying to override.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: