Extension Driver: Fetching the Page Root?
This is an open discussion with 2 replies, filed under Extensions.
Search
I had the same problem — $context in this instance is an object with mostly private members which cannot be accessed.
You can however inspect the type of Administration::instance()->Page
like so:
if (Administration::instance()->Page instanceof contentBlueprintsSections) { var_dump(Administration::instance()->Page->_context); }
The use of the static Administration instance (and Frontend instance for front end pages) means the $context is mostly redundant in this instance. Of course, context elsewhere receives things such as arrays and IDs which can’t be gleaned from the parent instance.
Nick, that’s a great tip - thank you!
Create an account or sign in to comment.
I’m building an extension and I’m trying to do a quite simple thing: I’d like to insert a script to the backend pages when the user browses
/blueprints/sections/
.I know how to always append the script:
But how do I add a check for the currently browsed backend page? If I simple print
$context
I find something calledpageroot
which contains everything I need, but I don’t know how to access it.Any tips or ideas?