I'd like to decorator to augment searchable fields only if the request is within the cms / admin section of the site. So far I do the detection as follows;
if(substr(Controller::curr()->getRequest()->getURL(), 0, 6) == 'admin/')
There's a few flaws I see in this;
1. It is long.
2. It is hardcoded & I don't account for the admin section changing from 'admin/'. (e.g. it doesn't use a static method to determine the actual base CMS url).
Is there a better & more recommended method?
Thanks!