Vvveb CMS exposes a wide set of events that allow plugins and extensions to modify data, inject functionality, or react to system actions. Events are triggered throughout components, controllers, and core systems, giving developers flexible integration points without modifying core code.


Component Events

Every component triggers at least one event in its results() method. This allows plugins to filter or modify the data returned by the component before it is rendered.

list($results) = Event::trigger(__CLASS__, __FUNCTION__, $results);

You can attach to any component’s results event:

// filter comments and add gravatars for users that don't have an avatar,  __CLASS__ is usually used instead of 'Vvveb\Plugins\GravatarPlugin' for convenience.
Event::on('Vvveb\Component\Comments', 'results', 'Vvveb\Plugins\GravatarPlugin' , function ($comments) {
	foreach ($comments['comments'] as &$comment) {
		$comment['avatar'] = 'https://www.gravatar.com/avatar/' . md5(strtolower($comment['email']));
	}
	return [$comments];
});

This pattern applies to all components.
View components list


Admin Events

Admin Menu

Plugins can add items to the admin dashboard menu by attaching to the init-menu event in the Vvveb\Controller\Base namespace.

// add a new entry in the admin dashboard menu, used by plugins to add a link to plugin settings
Event::on('Vvveb\Controller\Base', 'init-menu', __CLASS__, function ($menu) use ($admin_path) {
	$menu['plugins']['items']['insert-scripts'] = [
		'name'     => __('Insert scripts'),
		'url'      => $admin_path . '?module=plugins/insert-scripts/settings',
		//'icon-img' => PUBLIC_PATH . 'plugins/insert-scripts/insert-scripts.svg',
		'icon'      => 'icon-storefront-outline',
	];

	return [$menu];
});

This is the primary hook for extending the admin interface.


Core System Events

View Rendering

Vvveb\System\Core\View

  • compile — Parameters: $template, $tplFile, $templateEngine, $view
    Triggered when a template is compiled. Useful for inserting additional template files or modifying template behavior.

  • render — Parameters: $template, $filename, $tplFile, $templateEngine, $view
    Triggered before rendering. Useful for adding data to the view or altering output.

Image Processing

Vvveb\System\Images

  • publicPath — Parameters: $publicPath, $type, $image, $size
    Modify the public path or metadata before an image is resized.

  • image — Parameters: $image, $type, $size
    Modify the final image path or metadata after resizing.


Extension Events

Extensions Manager

Vvveb\System\Extensions\Extensions

  • install — Parameters: $extensionZipFile, $success
    Triggered when a plugin or theme is installed.

Themes

Vvveb\System\Extensions\Themes

  • install — Parameters: $extensionZipFile, $success
    Triggered when a theme is installed.

Plugins

Vvveb\System\Extensions\Plugins

  • setup — Parameters: $pluginName, $site_id
    Triggered on first activation. Ideal for creating tables or initial setup.

  • activate — Parameters: $pluginName, $site_id
    Triggered when a plugin is activated.

  • deactivate — Parameters: $pluginName, $site_id
    Triggered when a plugin is deactivated.

  • uninstall — Parameters: $pluginName, $success
    Triggered when a plugin is removed.


Controller Events

Feed Controller

Vvveb\Controller\Feed

  • index — Parameters: $results
    Triggered after feed data is processed.

Post Controller

Vvveb\Controller\Post

  • index — Parameters: $content, $language, $slug
    Triggered before post data is processed on the post page.

Product Controller

Vvveb\Controller\Product

  • index — Parameters: $content, $language, $slug
    Triggered before product data is processed on the product page.

User Login

Vvveb\Controller\User\Login

  • login — Parameters: $userInfo
    Triggered before login validation. Returning false cancels login.

User Signup

Vvveb\Controller\User\Signup

  • addUser — Parameters: $userInfo
    Triggered before user creation. Returning false cancels signup.

User Password Reset

Vvveb\Controller\User\Reset

  • index — Parameters: $loginData
    Triggered before password reset validation. Returning false cancels the reset request.

These events form the backbone of Vvveb’s extensibility. They allow plugins to integrate deeply into the system while keeping core code untouched.