Giter Site home page Giter Site logo

Comments (4)

duncan3dc avatar duncan3dc commented on August 11, 2024

I'm struggling to reproduce your issue. I've created a test here and it seems to work as expected.

"view11" extends "base-alt" which is in a different path that has been added using addpath().

Can you put up a small example repo with the code demonstrating the issue?

from blade.

rafatrace avatar rafatrace commented on August 11, 2024

I was implementing this in a wrong way, my bad.
Another thing, is there a way to delete paths or does this happens automatically?

Imagine my situation:
I have, UsersController, BooksController and AuthorsController, on everyone one of this I'm adding paths for each controllers, since users views are stores in a different path, like in the example above.

If I go to users, then books, then authors my paths array will have this 3 paths to search for blade files in it. If I go to users again will it add Users path again, and make 4 paths on the array?

What about a deletePath method? I mean, it will be less consumable if when I'm going to users controller it will search views only in users path instead of going to author path, then to books and finally to the users. Maybe your class does this already and I didn't find it.

Thanks for your time and work.

from blade.

duncan3dc avatar duncan3dc commented on August 11, 2024

The paths are managed by the underlying project and they don't offer any kind of deletePath.

You could create a copy of your blade instance to pass to your controller, then adding the controller specific path wouldn't affect the parent instance, something like:

$blade = new BladeInstance;

$blade->addPath("default");

$usersBlade = clone $blade;
$usersBlade->addPath("users");

from blade.

rafatrace avatar rafatrace commented on August 11, 2024

That seem like a nice implementation to my use case.
Thanks again @duncan3dc

Cheers

from blade.

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.