PHP Classes

File: engine/modules/core/meta/meta.qtags.inc

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/core/meta/meta.qtags.inc   Download  
File: engine/modules/core/meta/meta.qtags.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 5 years ago
Size: 753 bytes
 

Contents

Class file image Download
<?php
/**
 * Implements qtag META_DATA.
 *
 * Automatically generated page meta data.
 *
 * @param Environment $env
 * The Environment.
 *
 * @param string $target
 * The qtag's target.
 *
 * @param array $attributes
 * The qtag's attributes.
 *
 * @return string
 * The rendered qtag.
 */
function qtag_META_DATA($env, $target, $attributes) {
 
$meta = $env->getData('metadata');
 
$metatags = array();

  foreach (
$meta as $meta_name => $meta_content) {
   
$properties = array();
    foreach (
$meta_content as $type => $value) {
     
$properties[] = $type . '="' . $value . '"';
    }
   
$metatags[] = '<meta name="' . $meta_name . '" ' . str_replace("\n"," ",implode(' ', $properties)) . ' />';
  }

    return
implode("\n", $metatags);
}