Skip to content
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

Modal inside view #147

Closed
duanhdan opened this issue Sep 11, 2020 · 3 comments
Closed

Modal inside view #147

duanhdan opened this issue Sep 11, 2020 · 3 comments

Comments

@duanhdan
Copy link

Hi,
I've read document about modal with livewire at this docs
But when I paste these code into my view I got this message:

ErrorException Undefined variable: _instance (View: /var/www/html/resources/views/vendor/jetstream/components/modal.blade.php) (View: /var/www/html/resources/views/vendor/jetstream/components/modal.blade.php) (View: /var/www/html/resources/views/vendor/jetstream/components/modal.blade.php)
The document doesn't show how to embedded the source, somebody could show me the sample?

@driesvints
Copy link
Member

Hey there,

Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to report back and I'll gladly help you out and re-open this issue.

Thanks!

@duanhdan
Copy link
Author

I saw this line in the cache view

<div id="<?php echo e($id); ?>" x-data="{ show: <?php if ((object) ($attributes->wire('model')) instanceof \Livewire\WireDirective) : ?>window.Livewire.find('<?php echo e($_instance->id); ?>').entangle('<?php echo e($attributes->wire('model')->value()); ?>')<?php echo e($attributes->wire('model')->hasModifier('defer') ? '.defer' : ''); ?> <?php else : ?> window.Livewire.find('<?php echo e($_instance->id); ?>').entangle('<?php echo e($attributes->wire('model')); ?>') <?php endif; ?> }"

I don't know why PHP can't detect $_instance object.

@aceclarke
Copy link

I feel like I am running into a very similar issue. I am having problems with livewire and getting a basic data variable passed from the component to render in the view. Same error but basic context. My searches in other forums have come up empty so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants