PHP Classes

File: examples/tags/advert/tag.php

Recommend this page to a friend!
  Classes of Oliver Lillie  >  PHP Custom Tags  >  examples/tags/advert/tag.php  >  Download  
File: examples/tags/advert/tag.php
Role: Auxiliary script
Content type: text/plain
Description: Example script
Class: PHP Custom Tags
Template engine based on tags similar to HTML
Author: By
Last change: Update of examples/tags/advert/tag.php
Date: 10 months ago
Size: 1,248 bytes


Class file image Download

namespace CustomTags;

     * Advert Block.
     * This allows easy adding of adverts.
     * template - This is the id of the add you wish to place.
     * fallback - If the first template fails an you want to supply a fallback advert. If supplied it will be checked before usage
     * fail_silently - If set to true and and an advert template is missing then the advert block will fail silently. It defaults to true
$template = isset($tag['attributes']['template']) ? trim($tag['attributes']['template']) : false;
$template === false || empty($template))
$tag_data = CustomTags::throwError($tag['name'], 'tag has not been supplied with a template');
$fail_silently = isset($tag['attributes']['fail_silently']) && $tag['attributes']['fail_silently'] == 'false' ? false : true;
$use_fallback = isset($tag['attributes']['fallback']);
$template = CustomTagsHelper::getTemplate($tag, !$use_fallback || !$fail_silently);
$tag_data = $template;
        else if(
$tag['attributes']['template'] = $tag['attributes']['fallback'];
$tag_data = CustomTagsHelper::getTemplate($tag, $fail_silently);

For more information send a message to info at phpclasses dot org.