Documentation / Documentation for web designers 

WYSIWYG

This word that stays for What You See Is What You Get and is probably the best feature of RainTPL. This feature allows you to design HTML templates as static web pages, with images and css, that you can immediately check on your browser.

RainTPL replace for you all the relative paths of your template with the correct server paths.


Example:
The template is page.html and the image is in tpl/img/logo.jpg

<img src="img/logo.jpg"/>

Output:

<img src="tpl/img/logo.jpg"/>



Absolute path and path ending with # (pound sign) are not be replaced.

Example:

<img src="files/logo.jpg#"/>
<img src="http://www.raincms.com/logo.jpg"/>

Output:

<img src="files/logo.jpg"/>
<img src="http://www.raincms.com/logo.jpg"/>



By default, RainTPL replace the relative paths for the tags <img>, <link>, <script>, <input> and <a>. You can set the path_replace_list with the Raintpl::Configure method.

You can also configure the Raintpl::$base_url, which is used as a base of the replacement:

PHP

raintpl::configure("base_url", "http://www.raincms.com" );

Template:

<img src="img/logo.jpg"/>

Output:

<img src="http://www.raincms.com/tpl/img/logo.jpg"/>


Note: the <a> tag is replaced only if it is configured the Raintpl::$base_url.

« Knowledge Base ^ Documentation for web designers ^ RainTPL Tags »

Documentation for web designers




Documentation for PHP developers