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

HTML_QuickForm_element::freeze()

Вернуться к: Base classes

HTML_QuickForm_element::freeze()

HTML_QuickForm_element::freeze() – Freezes the element

Synopsis

require_once 'HTML/QuickForm/element.php';

void HTML_QuickForm_element::freeze ( )

When the element is displayed after the call to freeze(), only its value is displayed without the input tags, thus the element cannot be edited. If persistant freeze is set, then hidden field containing the element value will be output, too.

This method makes sense only with the elements that actually are editable in the first place. It has no effect on buttons, images, hidden fields, static content and the like.

Throws

throws no exceptions thrown

Note

This function can not be called statically.

Example

Freezing the text element

<?php
require_once 'HTML/QuickForm.php';

$text =& HTML_QuickForm::createElement('text''freezeMe');
$text->setValue('Some value');
echo 
$text->toHtml() . "\n";
$text->freeze();
echo 
$text->toHtml() . "\n";
$text->setPersistantFreeze(false);
echo 
$text->toHtml() . "\n";
$text->unfreeze();
echo 
$text->toHtml() . "\n";
?>

Output

 
<input name="freezeMe" type="text" value="Some value" />
Some value<input type="hidden" name="freezeMe" value="Some value" />
Some value
<input name="freezeMe" type="text" value="Some value" />


Вернуться к: Base classes

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