php - Magento Dependency Custom Form -
i new magento , working in making updates module. far i've seen form configuration admin done through system.xml, need add sort of dependency want form check api credentials if correct show other inputs. i've tried depends tag not being able call function there.
so have 2 questions: how manage make dependency when depends on value not know unless consult example api, can like:
<usertoken translate="label"> <label>user token</label> <frontend_type>text</frontend_type> <sort_order>1</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </usertoken> <new_value translate="label"> <label>new value</label> <frontend_type>text</frontend_type> <sort_order>1</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <depends><usertoken><action>mymodule/system_config_source_token/retorno</action></usertoken></depends> </new_value> if so, should use instead of action.
my seccond question is, there other way construct form in admin panel using system.xml, create own custom forms, using ajax, tables checkboxes.... understand how can integrate that.
is there other way construct form in admin panel using system.xml, create own custom forms, using ajax, tables checkboxes.... understand how can integrate that.
yes there is. magento quite modular, , see in xml configuration has counterpart in php code. of php code can extend in own modules.
you integrate best using step debugger , locate functionality in core magento. consider 1 of many ways on how extend magento apply / inject changes you're looking for. ´ in case you're asking wrong question. configuration value not depend on one. it's either there or not , code produce shouldn't searching ask information needs run. should keep overall logic less complex = less bugs.
the correct question be: why dependency within configuration , not within code?
Comments
Post a Comment