سؤال

I am learning Joomla! and I am building my first component.
My problem is now that I have a form that needs to store data in the db.
All is working right up until that point. The table that my form is using is not getting any values. So all that is ever saved is NULL values.

How do I get the values from the form fields into my table?

I am using Joomla 3.2

This is the error I keep getting

Save failed with the following error: SQL=INSERT INTO `test_redbiz_note` () VALUES ()

code:

controller

table

form

model

هل كانت مفيدة؟

المحلول

So I found a solution.

I still cant get joomla to get the form values to the table so I have to do it myself by overwriting save() in my controller.

   public function save()
   {
        $table = $this->getModel()->getTable();
        $jinput = JFactory::getApplication()->input;
        $JinputFilteredData = $jinput->POST->get('jform','','array');
        $values = $JinputFilteredData["GroupOfFields"];
        $table->bind($values);
        $table->store();
        return;
    }

This does not seem to be the best solution though...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top