I am trying to make a view on my package, and this is my code:
View::make("User::login");
But I get this error: No hint path defined for [User].
My structure is like this:
app
├──config
├──database
├── modules
└── Core
└── User
├──Controllers
├──models
└──views
└──login.blade.php
├── lang
├── migrations
└── routes.php
The view namespaces actually have nothing to do with PSR-4. You also have to add view directories manually. You can either do that by adding it to the paths
array in config/view.php
or by registering it somewhere else (preferably in a service provider)
View::addLocation('/path/to/views');
To come back to your actual question, you can register view namespaces like this:
View::addNamespace('User', '/path/to/views');
i've resolved my problem. it was my fault, it should be :
View::make("Core/User::login");
thanks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.