问题描述
我是joomla2.5的新手,我正在开发一个表单组件,该组件将简单地从用户获取数据并将其保存到数据库,但是我对表单重定向感到困惑.
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.
请告诉我这是什么意思
index.php?option = com_users& task = registration.register
index.php?option=com_users&task=registration.register
请给我定义"task = registration.register",包括点号.
please define me "task=registration.register" including dot also.
index.php?option = com_test2& view = test2
index.php?option=com_test2&view=test2
请定义视图和任务之间的区别,以及joomla2.5 url结构的基本原理是什么.
please define different between view and task and what is joomla2.5 url structure fundamentals.
感谢
推荐答案
在Joomla中,
视图代表组件视图.一个组件具有多个视图,例如Joomla默认组件com_users具有不同的视图
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.
喜欢这里
index.php?option = com_users& task = registration.register
index.php?option=com_users&task=registration.register
registration
控制器的功能名称带有register
registration
controller have a function name with register
在视图中
index.php?option = com_test2& view = test2
index.php?option=com_test2&view=test2
表示组件com_test2
具有一个包含test2
means component com_test2
have a view folder with test2
通过其他方式,您可以使用隐藏字段来访问控制器内的register
函数.如果您有要提交的表格,则类似.
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"/>
您将在此处
希望它能提供帮助.
这篇关于joomla 2.5中的视图和任务之间的区别是什么?joomla 2.5中的url结构是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!