I have a code that's dependent on an extension, could someone provide me with the "if" line of code condition that I would put around the code to test for this extension? Let's say the extension's name is "Joe1234".
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.
Hi!
I recommend you make a subdomain for testing all extensions/modifications. Or you can set a developer cookie that contains some password and check them in your controller.
1. Set cookie "dev=bae4csd'. You can use DevTools->Application->Cookie
2. Put cookie in data array
3. Check is_dev
I recommend you make a subdomain for testing all extensions/modifications. Or you can set a developer cookie that contains some password and check them in your controller.
1. Set cookie "dev=bae4csd'. You can use DevTools->Application->Cookie
2. Put cookie in data array
Code: Select all
$data['is_dev'] = ((isset($this->request->cookie['dev']) && $this->request->cookie['dev'] == 'bae4csd') ? true : false);
Code: Select all
{% if (is_dev) %}
//your code
{% endif %}
My extensions in marketplace. [ security | flexibility | speedup ]
Thanks for that, good idea. For some reason I just couldn't get it to work with true/false, so I'm testing for the cookie and the value instead:
...or will this cause an unforeseen issue somehow?
Code: Select all
setcookie("PBS", "1", time() + (86400 * 30), "/");
;=========================================================================;
if (isset($this->request->cookie['PBS']) && $this->request->cookie['PBS'] == "1") {
}
v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.