<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WEBPIRATEN &#187; css</title>
	<atom:link href="http://webpiraten.de/index.php/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpiraten.de</link>
	<description>Techblog</description>
	<lastBuildDate>Sun, 05 Feb 2012 12:52:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>:nth-of-type Pseudo-Klasse macht Tabellen-Zeilen Highlighting einfach</title>
		<link>http://webpiraten.de/index.php/layout-styles/nth-of-type-pseudo-klasse-macht-tabellen-zeilen-highlighting-einfach/</link>
		<comments>http://webpiraten.de/index.php/layout-styles/nth-of-type-pseudo-klasse-macht-tabellen-zeilen-highlighting-einfach/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 10:51:56 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Layout & Styles]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css 3]]></category>
		<category><![CDATA[highlight]]></category>
		<category><![CDATA[klasse]]></category>
		<category><![CDATA[of type]]></category>
		<category><![CDATA[pseudo]]></category>
		<category><![CDATA[row]]></category>
		<category><![CDATA[tabelle]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=227</guid>
		<description><![CDATA[Das abwechselnd farbliche Absetzen von Tabellenzeilen in HTML kann auch mittels einer CSS 3 Pseudo Klasse umgesetzt werden. Der InternetExplorer weigert sich leider bis dato diese CSS 3 Angaben zu interpretieren. Mehr Informationen zu CSS 3 Selektoren liefert der W3C]]></description>
			<content:encoded><![CDATA[<p>Das abwechselnd farbliche Absetzen von Tabellenzeilen in HTML kann auch mittels einer CSS 3 Pseudo Klasse umgesetzt werden.</p>
<pre class="brush: css; title: ; notranslate">
/* heighlight jeder 2ten zeile beginnend mit der ersten */
tr:nth-of-type(2n+1) { background-color:#f7f7f7; }

/* heighlight jeder 2ten zeile beginnend mit der zweiten */
tr:nth-of-type(2n) { background-color:#f7f7f7; }
</pre>
<p>Der InternetExplorer weigert sich leider bis dato diese CSS 3 Angaben zu interpretieren.</p>
<p>Mehr Informationen zu CSS 3 Selektoren liefert der <a href="http://www.w3.org/TR/css3-selectors/#structural-pseudos">W3C</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/layout-styles/nth-of-type-pseudo-klasse-macht-tabellen-zeilen-highlighting-einfach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>der Kohana Script Collector Helper</title>
		<link>http://webpiraten.de/index.php/frameworks/der-kohana-script-collector-helper/</link>
		<comments>http://webpiraten.de/index.php/frameworks/der-kohana-script-collector-helper/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 19:26:49 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[collector]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[stylesheet]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=89</guid>
		<description><![CDATA[Um modular und agil in Kohana zu entwickeln, wurde ein Skript Kollektor notwendig, der aus allen Controllern (Template- oder Standard-Controllern) Skripte (CSS, Javascript) sammeln kann. Diese Scripte werden dann auf den jeweiligen Mastertemplates wieder an den richtigen Stellen eingebunden. Dazu &#8230; <a href="http://webpiraten.de/index.php/frameworks/der-kohana-script-collector-helper/">weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Um modular und agil in Kohana zu entwickeln, wurde ein Skript Kollektor notwendig, der aus allen Controllern (Template- oder Standard-Controllern) Skripte (CSS, Javascript) sammeln kann.</p>
<p>Diese Scripte werden dann auf den jeweiligen Mastertemplates wieder an den richtigen Stellen eingebunden.<br />
Dazu habe ich einen neuen Helper unter application/helpers/collector.php eingerichtet.</p>
<pre class="brush: php; title: ; notranslate">

class Collector_Core
{
    /**
     * Arrays containing URL's to scripts/styles (fill with standards)
     * @var string
     */
    static protected $scripts       = array();
    static protected $styles        = array();

    /**
     * Adds a url to store
     * @param string $file the local path to file
     * @return void
     */
    static public function addJs($file)
    {
        self::$scripts[] = $file;
    }

    /**
     * Adds a url to store
     * @param string $file the local path to file
     * @return void
     */
    static public function addCss($file)
    {
        self::$styles[] = $file;
    }

    /**
     * Generates/renders collectors items
     * @param boolean      $print whether to echo the output or just return rendered string
     * @return string      the rendered output
     */
    static public function renderJs($print = false)
    {
        $scripts    = array_unique(self::$scripts);
        $output     = html::script($scripts);
        if ($print)
        {
            echo $output;
        }
        else
        {
            return $output;
        }
    }

    /**
     * Generates/renders collectors items
     * @param boolean      $print whether to echo the output or just return rendered string
     * @param string|array $media type for this style (all, screen, print, media)
     * @return string      the rendered output
     */
    static public function renderCss($print = false, $media = 'all')
    {
        $styles = array_unique(self::$styles);
        $output = html::stylesheet($styles, $media);
        if ($print)
        {
            echo $output;
        }
        else
        {
            return $output;
        }
    }
} // end of Collector_Core
</pre>
<p>Dieser Helper kann nun aus allen Controllern heraus befüllt werden.</p>
<pre class="brush: php; title: ; notranslate">

class Welcome_Controller extends Template_Controller
{
    /**
     * set master template
     */
    public $template = 'master_default.tpl';

    /**
     * default constructor
     * @param void
     * @return void
     */
    public function __construct()
    {
        // load parent constructor
        parent::__construct();

        // collect scripts and styles
        collector::addCss('/css/fancybox');
        collector::addJs('/js/jquery.1.3.2');
        collector::addJs('/js/jquery.fancybox');
    }
    /** more code here */
} // end of Welcome_Controller
</pre>
<p>Nachdem nun alle relevanten Skripte eingesammelt wurden, kann man diese auf dem Template wieder ausgeben lassen.</p>
<pre class="brush: xml; title: ; notranslate">

&lt;?php collector::renderCss(true, 'all'); ?&gt;

&lt;!-- html code here --&gt;

&lt;?php collector::renderJs(true); ?&gt;
</pre>
<p>Der Kollektor sorgt dafür das keine doppelten Skripte geladen werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/frameworks/der-kohana-script-collector-helper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

