Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about 20 Adding Ajax #8

Open
vomoa opened this issue Feb 12, 2019 · 1 comment
Open

Question about 20 Adding Ajax #8

vomoa opened this issue Feb 12, 2019 · 1 comment

Comments

@vomoa
Copy link

vomoa commented Feb 12, 2019

Hello Steve,
why do we have to use the main controller.php for checking the right token?
If no url is given then the json request ist routed to index.php?option=com_helloworld&view=helloworld...
so why don't use the view.json.php to check the token also.
The additional function mapsearch is not needed any more, therefore not included in the json ajax call.
There is more flexibility to use several jason ajax requests at serveral views of one component (that's I want to do).
Please give me a short reply of your opinion to this. It's just a question of better understanding.
Best regards,
vomoa
com_hellow2.zip

@robbiejackson
Copy link

I don't think it matters functionally whether you do the check in the controller or in the view.
The convention within the Joomla core components seems to be that they perform the check in the controller though, and from that perspective I think it's best to follow that pattern.
The Joomla team may do it this way because if the token is wrong or missing then it indicates something suspicious, so the http request is rejected as a priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants