Detect previous page visited
PermalinkYou could save it into an array as a stack rather than a fixed value. There may be situations involving a redirect that would confuse a single value. If you do, trim the length to prevent it growing too big
An alternative strategy would be to make a database query on the PageStatistics table and get the last entry. That should work as long as statistics are not disabled. Same provision as above on redirects possibly confusing things slightly.
I am almost embarrassed to respond back to you with a sense that it may show an unfamiliarity with Concrete5, even though I have been working with it now for a couple of years. Concrete5 is a really deeply constructed work. No matter, how much I search, there are a lot subtleties on it's operation that are buried within it.
Here are thequestions I am left with:
1) How would one create an on_before_render handler from within the on_start method in the installer controller?
2) Where is this created method going to be placed if not in the same controller?
3) If this created method is to run from the installer controller, wouldn't it have to run every time a request for a page is passed to the website?
What I need is a Hook into the Dispatcher load. Is this possible? I have just visited a Forum Post created by someone else needing this same thing.
However, a core override like you are thinking of would be marginal on approval, it may just creep in as black.
You can find example code for the events in the package controller of my Load jQuery.UI addon (look at the attribute version, not the block version)
Rather than events, using PageStatistics would probably be more efficient (but you never can tell until you run a benchmark).
Another way to do it would be with some javascript to set a cookie for every page after it has loaded. You could then read the cookie from php.
All of the above would fall down to some extent when full page caching is force enabled. (but then so does pretty much anything interactive).
I would like to know how to remove an event handler after it has been set in the on_start method. I noticed in your package that you have no code to remove your event handler in your uninstall method other than the call to parent::uninstall(). Does this automatically remove any hooks generated by the installer controller?
I have one more thing puzzling me. After installing my package, the block selection menu shows only half of a selection bar and no title. I haven't been able to find anything that may be causing this.
Thanks,
ThomasJ
Event handlers in packages disappear when the package is uninstalled.
I have uploaded the next version to look at, 0.9.6.
Thanks
then use those variables wherever you need them to do what you want.