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

Add ViewOnly widget class to pass options #119

Merged
merged 15 commits into from
Mar 29, 2022
Merged

Add ViewOnly widget class to pass options #119

merged 15 commits into from
Mar 29, 2022

Conversation

quintenbuis
Copy link
Contributor

This PR adds a ViewOnly class that takes the view name as the render method argument and passes options to that view.

Before the widget config option must follow the following structure:

'widgets' => [
    'Magento\Cms\Block\Widget\Block'                   => Rapidez\Core\Widgets\Block::class,
],

Now instead mapping the Magento block to a full class string you can pass a view name and it will grab the view_only_widget class in the config and render the view:

'widgets' => [
    'Magento\Cms\Block\Widget\Block'                   => 'widget-with-options-view',
],

The ViewOnly class can also be customized in the config:

'view_only_widget' => \Rapidez\Core\Widgets\ViewOnly::class,

@royduin royduin merged commit bad872e into rapidez:master Mar 29, 2022
@royduin
Copy link
Member

royduin commented Mar 29, 2022

Thanks! 💯 Docs: https://docs.rapidez.io/0.x/extending.html#widgets

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

Successfully merging this pull request may close these issues.

3 participants