BlogController.php in Blog 8.2
Same filename and directory in other branches
Namespace
Drupal\blog\ControllerFile
src/Controller/BlogController.phpView source
<?php
namespace Drupal\blog\Controller;
use Drupal\blog\BlogListerInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\user\UserInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Controller routines for blog.
*/
class BlogController implements ContainerInjectionInterface {
/**
* The blog lister.
*
* @var \Drupal\blog\BlogListerInterface
*/
protected $blogLister;
/**
* Constructs a BlogController object.
*
* @param \Drupal\blog\BlogListerInterface $blogLister
* The blog lister.
*/
public final function __construct(BlogListerInterface $blogLister) {
$this->blogLister = $blogLister;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('blog.lister'));
}
/**
* Returns a title for user blog pages.
*
* @param \Drupal\user\UserInterface $user
*
* @return string
* A title string for a user blog page.
*/
public function userBlogTitle(UserInterface $user) {
return $this->blogLister
->userBlogTitle($user);
}
}
Classes
Name | Description |
---|---|
BlogController | Controller routines for blog. |