You are here

class BlogController in Blog 8.2

Same name and namespace in other branches
  1. 3.x src/Controller/BlogController.php \Drupal\blog\Controller\BlogController

Controller routines for blog.

Hierarchy

Expanded class hierarchy of BlogController

File

src/Controller/BlogController.php, line 13

Namespace

Drupal\blog\Controller
View 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

Namesort descending Modifiers Type Description Overrides
BlogController::$blogLister protected property The blog lister.
BlogController::create public static function Instantiates a new instance of this class. Overrides ContainerInjectionInterface::create
BlogController::userBlogTitle public function Returns a title for user blog pages.
BlogController::__construct final public function Constructs a BlogController object.