class BlogController in Blog 3.x
Same name and namespace in other branches
- 8.2 src/Controller/BlogController.php \Drupal\blog\Controller\BlogController
Controller routines for blog.
Hierarchy
- class \Drupal\blog\Controller\BlogController implements ContainerInjectionInterface
Expanded class hierarchy of BlogController
File
- src/
Controller/ BlogController.php, line 13
Namespace
Drupal\blog\ControllerView source
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);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlogController:: |
protected | property | The blog lister. | |
BlogController:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
BlogController:: |
public | function | Returns a title for user blog pages. | |
BlogController:: |
final public | function | Constructs a BlogController object. |