정의 위치

  • ./classes/context/Context.class.php

정의 내용

/**
 * Add the meta tag
 *
 * @param string $name name of meta tag
 * @param string $content content of meta tag
 * @param mixed $is_http_equiv value of http_equiv
 * @return void
 */
function addMetaTag($name, $content, $is_http_equiv = FALSE)
{
    is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
    $self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
}

 

파라메터

  • string $name : <meta> 태그의 name 요소 값입니다.
  • string $content : <meta> 태그의 content 요소 값입니다.
  • boolen $is_http_equiv : <meta> 태그 중 name 요소 대신 http-equiv 요소가 들어가는지 여부입니다. TRUE 또는 FALSE 값을 가집니다.

용도

  • <meta> 태그를 입력합니다.
  • 현재까지 배포된 XE 1.8.7 기준으로 mobile 페이지에선 지원되지 않고 있다.

예제

  • 안드로이드 크롬용 테마 색 입력하는 XE 템플릿 코드
    • {@Context::addMetaTag('theme-color', '#eeeeee', FALSE)}

       
    • 결과 : <meta name="theme-color" content="#eeeeee">
  • 키워드 입력해보기
    • Context::addMetaTag('keywords', 'HTML, CSS, XML, XHTML, JavaScript', FALSE);

       
    • 결과 : <meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">