Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 20475 программистов и 982 робота. Сейчас ищут 803 программиста ...

{end:}

Вернуться к: HTML_Template_Flexy

{end:}

{end:} – closes an if or foreach block

Synopsis

Usage ( {end:} )

adds a closing brace in PHP so that blocks of conditional HTML are shown correctly. You do not need to use {end:} tags if you are using HTML tag attributes like IF="a,b", as the closing HTML tag will indicate that.

Example

Setting variables for if

           class example {     function showDog() {         return true;     }      function output() {                  $this->showStuff = true;                  .........         $template->outputObject($this);     } }

The template

     {if:showStuff}Hello{end:} {if:showDog()}Doggy{end:}

The compiled template

                 <?php if ($t->showStuff)  { ?>Hello<?php } ?> <?php if ($t->showDog()) {  ?>Doggy<?php } ?>

The output

                 Hello Doggy


Вернуться к: HTML_Template_Flexy

© 2024 «PHP.RU — Сообщество PHP-Программистов»
Главная | Форум | Реклама на сайте | Контакты VIP Сувениры
Разработка компании ODware