Comments (4)
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.
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.
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.
That seem like a nice implementation to my use case.
Thanks again @duncan3dc
Cheers
from blade.
Related Issues (20)
- Could not reach BladeInstance->getViewFactory() method HOT 4
- Cache files not automatically refreshed in development, using phpstorm HOT 6
- Can't use the "$this" HOT 6
- How would one get url parameters from the route request? HOT 2
- suggestion for configuration HOT 5
- without cache HOT 1
- Non existent variable does not throw ErrorException HOT 2
- Return value of duncan3dc\Laravel\Directives::register() must be an instance of duncan3dc\Laravel\void, none returned HOT 2
- How to set default for @yield via @include file HOT 3
- Where are Document this package HOT 2
- The IDE shows error HOT 1
- Laravel 7 `x-` Components HOT 1
- it not update it's lluminate/filesystem version HOT 1
- 支持php8 HOT 1
- laravel 9.x support HOT 3
- View [categories.create] not found. HOT 1
- Please add support for PHP 8.2 HOT 1
- I've got Problem when I try install it with Symfony. HOT 2
- throw new InvalidArgumentException("View [$name] not found."); HOT 4
- Parser error on webhost HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blade.