Artesaos\SEOTools\SEOTools::setTitle PHP Method

setTitle() public method

Setup title for all seo providers.
public setTitle ( string $title ) : Artesaos\SEOTools\Contracts\SEOTools
$title string
return Artesaos\SEOTools\Contracts\SEOTools
    public function setTitle($title)
    {
        $this->metatags()->setTitle($title);
        $this->opengraph()->setTitle($title);
        $this->twitter()->setTitle($title);
        return $this;
    }

Usage Example

Example #1
0
 public function test_set_title()
 {
     $this->seoTools->setTitle('Kamehamehaaaaaaa');
     $expected = "<title>Kamehamehaaaaaaa - It's Over 9000!</title>";
     $expected .= '<meta name="description" content="For those who helped create the Genki Dama">';
     $expected .= '<meta property="og:title" content="Kamehamehaaaaaaa" />';
     $expected .= '<meta property="og:description" content="For those who helped create the Genki Dama" />';
     $expected .= '<meta name="twitter:title" content="Kamehamehaaaaaaa" />';
     $this->assertEquals('Kamehamehaaaaaaa - It\'s Over 9000!', $this->seoTools->getTitle());
     $this->setRightAssertion($expected);
 }