joomla 2.5 中的视图和任务有什么区别,joomla 2.5 中的 url 结构是什么?
我是 joomla2.5 的新手,我正在开发一个表单组件,它可以简单地从用户那里获取数据并保存到数据库,但我对表单重定向感到困惑.
请告诉我这是什么意思:
index.php?option=com_users&task=registration.register
请给我定义task=registration.register",也包括点.
index.php?option=com_test2&view=test2
请定义视图和任务之间的区别以及什么是 joomla2.5 url 结构基础.
谢谢你的问候
解决方案在 Joomla 中,
View 代表组件视图.一个组件有多个视图,比如 Joomla 默认组件 com_users 有不同的视图
注册、简介等
Task 表示控制器文件中的函数.
喜欢这里
index.php?option=com_users&task=registration.register
registration
控制器有一个带有 register
在视图中
index.php?option=com_test2&view=test2
表示组件 com_test2
有一个带有 test2
在其他方式中,您可以使用隐藏字段访问控制器内的 register
功能.如果你有一个表单要提交,那么就像这样.
<input type="hidden" name="controller" value="registration"/><input type="hidden" name="task" value="register"/>
您可以从此处
希望它有所帮助..
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
解决方案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..
相关文章