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

{if:variable}

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

{if:variable}

{if:variable} – creates a PHP if statement

Synopsis

Usage ( {if:variable} , {if:method()} )

creates an if statement, with the argument as a variable or method. You must close an if statement with an {end:} statement, and you may use {else:} with it.

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:}

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