Coder Social home page Coder Social logo

pattern not working about active HOT 6 CLOSED

letrunghieu avatar letrunghieu commented on August 20, 2024
pattern not working

from active.

Comments (6)

letrunghieu avatar letrunghieu commented on August 20, 2024

Sorry for the late respond, I have a hard week in my current project.

This is an expected behavior. The pattern method wild check the pattern with the current route URI from the start of the string. So /dragonfire1119 will not be matched by dragonfire1119 but *dragonfire1119 instead.

However, how can we get the /dragonfire1119 URI? I have try and only get /dragonfire1119 as URI when navigating to my-laravel.com/dragonfire1119 :(

from active.

dragonfire1119 avatar dragonfire1119 commented on August 20, 2024

Thanks for the response & it's fine everybody has to work.

Laravel has a helpful facade to get the URI

Request::path()

It returns dragonfire1119 if you want to get a slash on the start of the string that's easy.

$uri = '/' . Request::path();

I think that's what your asking?

from active.

letrunghieu avatar letrunghieu commented on August 20, 2024

May I know when did you call the Active::pattern method? I tried to go to localhost/dragonfire1119 and the result of Active::pattern('dragonfire1119') is stil correct (which is active string as expected).

from active.

dragonfire1119 avatar dragonfire1119 commented on August 20, 2024

@letrunghieu I called it on the html of the twitter bootstrap menu.

<li class="{{ Active::pattern(Auth::user()->username) }}"><a href="#">Link</a></li>

from active.

letrunghieu avatar letrunghieu commented on August 20, 2024

After setting up a demo project and simulating your actions. I've detect the incorrect code and fixed it. You can run composer update now to get the 1.2.1 version.
The demo project can be found at this repo
Thank you for help me improve this package 😸

from active.

dragonfire1119 avatar dragonfire1119 commented on August 20, 2024

@letrunghieu Your welcome glad I could help.

from active.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.