-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Member function view() #4
Comments
hybrid-core version 6 is/has been broken down into separate components rather than a whole system. Personally 5.x works fine.. I don't think is necessary to move to 6.. |
Yep, I used Hybrid for a long time, (since 1.5 😬 ) this is my first time trying to use 6.0 here are the packages I have installed:
My main reason to moving is for PHP 8+ compatibility and because the module approach in theory means fewer files since I won't need breadcrumbs or get_the_image for my use case. |
so the view should be or you can use helper function below. |
Yeah the theme is based on Mystic so is using:
|
haha, I was about to mention Mystic just now, but looks like you found what you need! |
The problem is when upgrading Mystic from Hybrid 5.x to 6.x there is the fatal error. I'm sure it's either a bug in this component, or I'm doing the upgrade wrong. So trying to figure out which it is. |
what does your bootstrap-app.php look like, did you add the view provider! |
even if you have those components install through composer, you need to add those specific components as a provider. so soemthing like this below so it becomes available to use!
|
the hierarchy provider works best with view together. then by adding a filter
without this filter, i think it defaults to |
did you ever get this resolved! |
You'll get that error when the |
If you could share your code, will be able to help you better. But here are is the relevant bit of code you need in your theme...
$mythic->register( \Hybrid\Template\Hierarchy\Provider::class );
$mythic->register( \Hybrid\Template\Manager\Provider::class );
$mythic->register( \Hybrid\Theme\Provider::class );
$mythic->register( \Hybrid\View\Provider::class );
use Hybrid\View\Contracts\Engine as EngineContract;
use Hybrid\View\Contracts\View as ViewContract; and ...
public function register() {
...
// Create aliases for the view and engine.
$this->app->alias( ViewContract::class, 'view' );
$this->app->alias( EngineContract::class, 'view/engine' );
...
...
"require": {
...
"themehybrid/hybrid-theme": "^1.0",
"themehybrid/hybrid-template-manager": "^1.0",
"themehybrid/hybrid-template-hierarchy": "^1.0",
"themehybrid/hybrid-template": "^1.0",
"themehybrid/hybrid-view": "^1.0",
...
},
... |
Did anyone get this to work? @saas786 wote: Anyone? |
@redactuk |
If you want to continue using the legacy view system but with HC v7, refer to the following links: You don't need the new Similarly, if you want to use it with HC v6: I can try to update both Mythic and Exhale to the latest code, but I think the current code should suffice for your needs. Here is the latest implementation, and you can also see the prefixing logic applied. |
I am attempting to upgrade from Hybird Core 5.x to 6.0 and getting the following error with views:
PHP 8.1
WordPress 6.1
I'm assuming the way a view is called is different for 6.0?
The text was updated successfully, but these errors were encountered: