1

I am newbie to joomla! component programming. i am creating a MVC component that users can reserve some dates.

my component should have a simple settings view that admin can manage the component. i used some references but i have problem to create this settings view and it doesn't work.

to do this, i created a #__mycomponent_settings table and a row that holds settings data and also added these files:

  • com_mycomponent/controllers/settings.php
  • com_mycomponent/models/settings.php
  • com_mycomponent/models/forms/settings.xml
  • com_mycomponent/tables/settings.php
  • com_mycomponent/views/settings/view.html.php
  • com_mycomponent/views/settings/tmpl/default.php

I defined my fields in the xml file and loaded them to the view correctly, but the real problem that confuses me is i really don't know how to use JForm and JTable correctly to submit and save data in the database or to retrieve previously saved data and put them into the fields. or how i should use JToolbarHelper to submit data or what must be entered in the action attribute of the form. i used save button of JToolbarHelper but it takes me to the

com_mycomponent&view=settings&layout=edit

but i didn't define any edit layout everywhere in me code!

i get so confused and will be appreciated if you help me.

1 Answers1

0

I'd strongly suggest using native joomla settings logic, instead of storing them on database. You can read more about it here http://docs.joomla.org/J2.5:Developing_a_MVC_Component/Adding_configuration (read only the Adding configuration parameters part

If you have more questions implementing it, I'll be happy yo help.

di3sel
  • 2,002
  • 15
  • 24
  • If this question is so broad that it cannot be answer succinctly, then perhaps this question should be closed as Too Broad. If you can succinctly answer this question in a way where most of the solution is _here_ (not held in a document hyperlink), then please improve/expand your answer. – mickmackusa Jul 20 '18 at 03:06