Welcome Guest, Not a member yet? Register   Sign In
url_is bug
#1
Bug 
(This post was last modified: 11-30-2021, 09:24 PM by mjamilasfihani. Edit Reason: I change the subject, because this is bug )

hi all! I just tried to use url_is function like this :
Code:
echo url_is('page?new=hello') ? 'active' : '';

and it doesn't work, as I want. I use CI 4.1.4, am I late information, or it's out of scope?
Reply
#2

page?new=hello is not a URI in this context.
page is a URI.
Reply
#3

(This post was last modified: 11-30-2021, 09:29 PM by mjamilasfihani.)

(11-30-2021, 09:24 PM)kenjis Wrote: page?new=hello is not a URI in this context.
page is a URI.

so, url_is only available for URI context only, isn't?

what if we add page?new=hello condition support?
Reply
#4

For example,

PHP Code:
        $uri $this->request->getUri();
        $uriWithQuery $uri->getPath() .'?'$uri->getQuery();
        echo ($uriWithQuery === 'home?new=hello') ? 'active' ''
Reply




Theme © iAndrew 2016 - Forum software by © MyBB