what is difference between view and task in joomla 2.5 and what is url structure in joomla 2.5?

匿名 (未验证) 提交于 2019-12-03 02:16:02

问题:

I'm new to joomla2.5 and i'm working on a form component that will simple get data from user and save to database but i have confusion regarding form redirect.

please tell me what means of this:

index.php?option=com_users&task=registration.register

please define me "task=registration.register" including dot also.

index.php?option=com_test2&view=test2

please define different between view and task and what is joomla2.5 url structure fundamentals.

Thanks with regards

回答1:

In Joomla,

View stands for component views. A component have multiple views like Joomla default component com_users have different views

registration,profile etc 

Task means the function inside your controller file.

like here

index.php?option=com_users&task=registration.register

registration controller have a function name with register

In the view

index.php?option=com_test2&view=test2

means component com_test2 have a view folder with test2

In other way you can access the register function inside your controller is by using hidden fields. If you have a form to submit then something like.

<input type="hidden" name="option" value="com_users"/> <input type="hidden" name="controller" value="registration"/> <input type="hidden" name="task" value="register"/> 

You will get more details about Joomla component structure from here

Hope its helps..



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!