-
☆ A M B ☆
- 3,112 Posts
What is the best practice of passing the MODx object to the class of an AJAX’s processor?
I tried to serialize and base64_decode the MODx object to be sent through the $_GET request.
But it beyond the URI address limit: request failed: URI too long (longer than 8190)
I believe it’s not a good idea of storing them into the cookie/session.
So, do you have any idea how to solve this?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
-
☆ A M B ☆
- 24,524 Posts
Use a resource with no template, just a snippet for the code, as the AJAX processor.
-
☆ A M B ☆
- 3,112 Posts
I don’t think I understand you completely, Susan.
I tried to call an AJAX processor as the snippet’s return.
But that processor has its own Class.
My problem is that some method call $this->modx->documentIdentifier, which returns null.
I also have tried to load the modx’s document parser (yes, in this case, I’m running Evo) separately, but the $modx object only had empty properties which I needed.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
-
☆ A M B ☆
- 872 Posts
I think she meant to create a resource with an empty template and create a snippet that will contain the instanciated MODx object and the ajax facilities that you need to use.
Didn’t try it with Evo but it should work.
Plus it will allow you to use the premission system if needed.
-
☆ A M B ☆
- 3,112 Posts
Hah!!! I got it!!!
You’re indeed a genius granny!
Thanks, Susan.
And thanks for clear things up, loss.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
-
☆ A M B ☆
- 24,524 Posts
I do that all the time. Just create a resource with no template, then create a snippet with the processing code; that snippet will be the only content of the resource. Then use the resource’s URL as the URL in the AJAX request. All the MODx stuff is already available, since it’s a snippet in a resource.