Need help with creating a very basic extension that output parameters
This is an open discussion with 2 replies, filed under Extensions.
Search
I'm not 100% sure about this but I think you can just use the __addParam
delegate in your extension.driver.php
file, like so: -
public function __addParam($context) { $context['params']['timestamp'] = getdate()[0]; }
That's how I added a simple production_mode
parameter to the paramater pool in my extension Production Mode - have a look at that file for the boilerplate extension stuff (you can remove the other appendPreferences
and __SavePreferences
) - I just copied one of the other extensions when I created that one.
Perhaps one of the more experienced extension writers can chime in with whether this is correct way to do this. Hope it helps.
EDIT: Here's a gist that I think should work obviously you'd also want to add an extension.meta.xml
file as well
@firegoby - Wow!!!! Thanks you so much! This is exactly what I needed!!!! Thank you!
Create an account or sign in to comment.
Need help with creating a very basic extension that output parameters. Actually, I just want to create a basic extension that outputs a unix timestamp.
So I need it to run this code...
echo(getdate()[0]);
which will output the unix timestamp.