Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
949 views
in Technique[技术] by (71.8m points)

php - what is difference between view and task in joomla 2.5 and what is url structure in joomla 2.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.

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...