Artesaos\SEOTools\SEOMeta::addKeyword PHP Method

addKeyword() public method

Add a keyword.
public addKeyword ( string | array $keyword ) : Artesaos\SEOTools\Contracts\MetaTags
$keyword string | array
return Artesaos\SEOTools\Contracts\MetaTags
    public function addKeyword($keyword)
    {
        if (is_array($keyword)) {
            $this->keywords = array_merge($keyword, $this->keywords);
        } else {
            $this->keywords[] = strip_tags($keyword);
        }
        return $this;
    }

Usage Example

Beispiel #1
0
 public function test_set_reset()
 {
     $expected = "<title>It's Over 9000!</title>";
     $expected .= "<meta name=\"description\" content=\"For those who helped create the Genki Dama\">";
     $this->seoMeta->setDescription('test');
     $this->seoMeta->addKeyword('test');
     $this->seoMeta->setNext('test');
     $this->seoMeta->setPrev('test');
     $this->seoMeta->setCanonical('test');
     $this->seoMeta->addMeta('test');
     $this->seoMeta->addAlternateLanguage('test', 'test');
     $this->seoMeta->reset();
     $this->setRightAssertion($expected);
 }