FeaturedEventWidget
in package
implements
IWidget
Featured event widget for displaying the next available featured event.
Renders a single card with the details of the next published featured event that has not yet ended. If no featured event is available it renders nothing visible (an HTML comment), so it is safe to place in any page or post.
Usage: [featured-event]
Table of Contents
Interfaces
- IWidget
- Widget interface for extensible shortcode/widget system.
Properties
Methods
- __construct() : mixed
- getAttributes() : array<string, string>
- Get supported attributes
- getDescription() : string
- Get widget description
- getName() : string
- Get widget shortcode name
- render() : string
- Render the featured event widget
- renderTemplate() : string
- Render widget template
Properties
$_eventRepository
private
DatabaseEventRepository
$_eventRepository
Methods
__construct()
public
__construct(DatabaseEventRepository $eventRepository) : mixed
Parameters
- $eventRepository : DatabaseEventRepository
getAttributes()
Get supported attributes
public
getAttributes() : array<string, string>
Return values
array<string, string>getDescription()
Get widget description
public
getDescription() : string
Return values
string —Widget description
getName()
Get widget shortcode name
public
getName() : string
Return values
string —Shortcode name (e.g., 'property-listings')
render()
Render the featured event widget
public
render(array<string, mixed> $attrs) : string
Parameters
- $attrs : array<string, mixed>
-
Shortcode attributes
Return values
string —Rendered HTML
renderTemplate()
Render widget template
private
renderTemplate(Event $event) : string
Parameters
- $event : Event