Location: PHPKode > scripts > Redstart Templating > Redstart-Templating-master/Redstart/Templating/Core/Html/CssList.php
<?php

namespace Redstart\Templating\Core\Html;

use Redstart\Util\Dict;

/**
 * Css List Plugin
 *
 * @package Redstart    
 * @subpackage Redstart_Templating_Core_Html
 *
 * @author Hyyan Abo Fakher
 * @since Redstart 1.0
 * @version 1.0
 */
class CssList extends Dict{

    private $inline;

    /**
     * Constrcut New Css Dict
     * @param boolean $inline 
     * @param array $dictionary
     */
    public function __construct($inline = true, $dictionary = array()) {
        parent::__construct($dictionary);
        $this->setInline($inline);
    }

    /**
     * Set css inline
     * @param boolean $boolean true to put css rules in one line or false to put
     *                         every css rule in its own line
     * @return \Redstart\Templating\Core\Html\CssList
     */
    public function setInline($boolean) {
        $this->inline = (boolean) $boolean;
        return $this;
    }

    /**
     * Check if css inline is enabled
     * @return boolean
     */
    public function isInline() {
        return $this->inline;
    }

    /**
     * Get dictionary as string
     * @return string
     */
    public function getString() {
        $result = "";
        $seprator = $this->isInline() ? PHP_EOL : "";
        foreach ($this as $key => $value) {
            if (!empty($key)) {
                $result.=sprintf('%s: %s;%s', $key, $value, $seprator);
            }
        }
        return $result;
    }

    /**
     * Get dictionary as string
     * @return string
     */
    public function __toString() {
        return $this->getString();
    }

}

Return current item: Redstart Templating