You are here

public function ProductVariationController::editTitle in Commerce Core 8.2

Provides the edit title callback for product variations.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

Return value

string The title for the product variation edit page.

File

modules/product/src/Controller/ProductVariationController.php, line 68

Class

ProductVariationController
Provides title callbacks for product variation routes.

Namespace

Drupal\commerce_product\Controller

Code

public function editTitle(RouteMatchInterface $route_match) {
  $product_variation = $route_match
    ->getParameter('commerce_product_variation');
  $product_variation = $this->entityRepository
    ->getTranslationFromContext($product_variation);
  return $this
    ->t('Edit %label', [
    '%label' => $product_variation
      ->label(),
  ]);
}