ClassesBigCommerceAmpAmp Controller Factory

Amp_Controller_Factory

Class Amp_Controller_Factory

Overrides the template controller factory to replace default template controllers with AMP-specific counterparts when required.

Methods

get_controller

Retrieves the appropriate controller for a given class name.

public get_controller(string $classname, array $options = [], string $template = ''): object

Overrides the default behavior by replacing the standard class name with its AMP counterpart if defined in the $override_class_map.

Parameters:

ParameterTypeDescription
$classnamestringFully-qualified class name of the controller.
$optionsarrayOptional parameters passed to the controller.
$templatestringOptional template name to associate with the controller.

Return Value:

The controller instance.


Inherited methods

get_controller

Creates an instance of the requested controller

public get_controller(string $classname, array $options = [], string $template = ''): \BigCommerce\Templates\Controller

Parameters:

ParameterTypeDescription
$classnamestring
$optionsarray
$templatestring


Automatically generated on 2025-01-21