5 * Contains \Drupal\linkit\Controller\LinkitController.
8 namespace Drupal\linkit\Controller;
10 use Drupal\Core\Controller\ControllerBase;
11 use Drupal\linkit\ProfileInterface;
14 * Provides route responses for linkit.module.
16 class LinkitController extends ControllerBase {
19 * Route title callback.
21 * @param \Drupal\linkit\ProfileInterface $linkit_profile
25 * The profile label as a render array.
27 public function profileTitle(ProfileInterface $linkit_profile) {
28 return $this->t('Edit %label profile', array('%label' => $linkit_profile->label()));
32 * Route title callback.
34 * @param \Drupal\linkit\ProfileInterface $linkit_profile
36 * @param string $plugin_instance_id
37 * The plugin instance id.
40 * The title for the matcher edit form.
42 public function matcherTitle(ProfileInterface $linkit_profile, $plugin_instance_id) {
43 /** @var \Drupal\linkit\MatcherInterface $matcher */
44 $matcher = $linkit_profile->getMatcher($plugin_instance_id);
45 return $this->t('Edit %label matcher', array('%label' => $matcher->getLabel()));
49 * Route title callback.
51 * @param \Drupal\linkit\ProfileInterface $linkit_profile
53 * @param string $plugin_instance_id
54 * The plugin instance id.
57 * The title for the attribute edit form.
59 public function attributeTitle(ProfileInterface $linkit_profile, $plugin_instance_id) {
60 /** @var \Drupal\linkit\AttributeInterface $attribute */
61 $attribute = $linkit_profile->getAttribute($plugin_instance_id);
62 return $this->t('Edit %label attribute', array('%label' => $attribute->getLabel()));