-
MODX Staff
- 10,725 Posts
No, handleRequest is responsible for handling routing to the Resources, including determining the proper target based on the request parameters, user data, and more.
Perhaps you should explain what you are trying to do.
-
MODX Staff
- 10,725 Posts
Can you not write a Plugin to execute OnHandleRequest, or OnWebPageInit or a similar event in the process? And when I asked for what you are trying to do, I meant what are you trying to accomplish. I didn’t really mean what approach are you using to do whatever it is you want to do.
Also, documentIdentifier is deprecated and will be gone in 2.1.x+, so I would suggest using resourceIdentifier. But again, this is not an appropriate variable for what it seems like you are trying to do.
Hi everybody,
it’s my first time here and I have a very similar problem.
Is there a way to obtain a resource object starting from its entire path?
something like $modx->getResourceFromPath( ’it/page1/page2/page.html’ )
I need to make an ajax call passing the entire path, and I need the resource object back.
thank you very much
alessandro
You could try accessing the $_REQUEST[’q’] and get it from the $modx->aliasMap. That was you’ll have the right object right away. Methods for alias backwards engineered do not exist, as they would require a huge load to simply get one resource (your example would require 4 queries, whereas the aliasmap would require 1 (or rather, a lot more, but that’s being done anyway).
@MarkGHErnst
Developer at Adwise Internetmarketing, the Netherlands.