Bolt\Twig\Handler\HtmlHandler::htmlLang PHP Method

htmlLang() public method

Returns the language value for in tags where the language attribute is required. The underscore '_' in the locale will be replaced with a hyphen '-'.
public htmlLang ( ) : string
return string
    public function htmlLang()
    {
        return str_replace('_', '-', $this->app['locale']);
    }

Usage Example

Esempio n. 1
0
 public function testHtmlLang()
 {
     $app = $this->getApp();
     $app['locale'] = 'en_Aussie_Mate';
     $handler = new HtmlHandler($app);
     $result = $handler->htmlLang();
     $this->assertSame('en-Aussie-Mate', $result);
 }