Skip to content

Refactor event handling and update view rendering in HelloWorld#9

Open
souzadavi wants to merge 4 commits into
AzuraCast:mainfrom
LinkNacional:main
Open

Refactor event handling and update view rendering in HelloWorld#9
souzadavi wants to merge 4 commits into
AzuraCast:mainfrom
LinkNacional:main

Conversation

@souzadavi
Copy link
Copy Markdown

This pull request updates the example AzuraCast plugin to improve compatibility and code quality, modernize dependencies, and streamline event handling and view rendering. The most important changes are grouped below:

Dependency and Compatibility Updates:

  • Added a PHP version requirement (>=8.2) to composer.json to ensure compatibility with newer PHP features.
  • Removed the empty "require": {} block from composer.json for cleaner dependency management.

Event Handling and Routing Improvements:

  • Updated event listeners in events.php:
    • Changed the view folder name from 'example' to 'ExamplePlugin' for consistency.
    • Simplified the route registration, using the HelloWorld controller directly and updating the route name to 'example:index'.
    • Commented out the subscriber registration for AllTheListeners to reduce noise in the example. [1] [2]

Controller and View Rendering Enhancements:

  • Refactored the HelloWorld controller:
    • Injected the DI container and view as dependencies.
    • Updated the view template namespace from 'example::hello_world' to 'ExamplePlugin::hello_world'.

Template Update:

  • Changed the layout in hello_world.phtml from 'minimal' to 'panel' for a more modern UI style.

Fixes issue:
Fix issue #8

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.

1 participant