Classes

File builder/element/SpanHTMLElement.class.php

File builder/element/SpanHTMLElement.class.php

 1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 
<?php
/**
 * @package     Builder
 * @subpackage  Element
 * @copyright   &copy; 2005-2019 PHPBoost
 * @license     https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL-3.0
 * @author      Julien BRISWALTER <j1.seth@phpboost.com>
 * @version     PHPBoost 5.2 - last update: 2017 03 19
 * @since       PHPBoost 4.1 - 2015 01 20
 * @contributor Julien BRISWALTER <j1.seth@phpboost.com>
*/

class SpanHTMLElement extends AbstractHTMLElement
{
    private $content;
    private $attributs = array();

    public function __construct($content, $attributs = array(), $css_class = '')
    {
        $this->content = $content;
        $this->attributs = $attributs;
        $this->css_class = $css_class;
    }

    public function display()
    {
        $tpl = new FileTemplate('framework/builder/element/SpanHTMLElement.tpl');

        $tpl->put_all(array(
            'C_HAS_CSS_CLASSES' => $this->has_css_class(),
            'CSS_CLASSES' => $this->get_css_class(),
            'CONTENT' => $this->content
        ));

        foreach ($this->attributs as $type => $value)
        {
            $tpl->assign_block_vars('attributs', array(
                'TYPE' => $type,
                'VALUE' => $value
            ));
        }

        return $tpl->render();
    }
}
?>