本文整理汇总了PHP中Nette\Application\UI\Control::isControlInvalid方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::isControlInvalid方法的具体用法?PHP Control::isControlInvalid怎么用?PHP Control::isControlInvalid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Control
的用法示例。
在下文中一共展示了Control::isControlInvalid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderSnippets
public static function renderSnippets(UI\Control $control, \stdClass $local, array $params)
{
$control->snippetMode = FALSE;
$payload = $control->getPresenter()->getPayload();
if (isset($local->blocks)) {
foreach ($local->blocks as $name => $function) {
if ($name[0] !== '_' || !$control->isControlInvalid((string) substr($name, 1))) {
continue;
}
ob_start(function () {
});
$function = reset($function);
$snippets = $function($local, $params + array('_snippetMode' => TRUE));
$payload->snippets[$id = $control->getSnippetId((string) substr($name, 1))] = ob_get_clean();
if ($snippets !== NULL) {
// pass FALSE from snippetArea
if ($snippets) {
$payload->snippets += $snippets;
}
unset($payload->snippets[$id]);
}
}
}
$control->snippetMode = TRUE;
if ($control instanceof UI\IRenderable) {
$queue = array($control);
do {
foreach (array_shift($queue)->getComponents() as $child) {
if ($child instanceof UI\IRenderable) {
if ($child->isControlInvalid()) {
$child->snippetMode = TRUE;
$child->render();
$child->snippetMode = FALSE;
}
} elseif ($child instanceof Nette\ComponentModel\IContainer) {
$queue[] = $child;
}
}
} while ($queue);
}
}
示例2: isControlInvalid
public function isControlInvalid($snippet = NULL)
{
return $this->control->isControlInvalid($snippet);
}
示例3: needsRedraw
public function needsRedraw($name)
{
return $this->control->isControlInvalid($name);
}
示例4: renderSnippets
public static function renderSnippets(Nette\Application\UI\Control $control, \stdClass $local, array $params)
{
$control->snippetMode = false;
$payload = $control->getPresenter()->getPayload();
if (isset($local->blocks)) {
foreach ($local->blocks as $name => $function) {
if ($name[0] !== '_' || !$control->isControlInvalid(substr($name, 1))) {
continue;
}
ob_start();
$function = reset($function);
$snippets = $function($local, $params);
$payload->snippets[$id = $control->getSnippetId(substr($name, 1))] = ob_get_clean();
if ($snippets) {
$payload->snippets += $snippets;
unset($payload->snippets[$id]);
}
}
}
$control->snippetMode = true;
if ($control instanceof Nette\Application\UI\IRenderable) {
$queue = array($control);
do {
foreach (array_shift($queue)->getComponents() as $child) {
if ($child instanceof Nette\Application\UI\IRenderable) {
if ($child->isControlInvalid()) {
$child->snippetMode = true;
$child->render();
$child->snippetMode = false;
}
} elseif ($child instanceof Nette\ComponentModel\IContainer) {
$queue[] = $child;
}
}
} while ($queue);
}
}
示例5:
Nette\InvalidStateException("Cannot include undefined parent block '$name'.");}$block($context,$params);}static
function
renderSnippets(Nette\Application\UI\Control$control,\stdClass$local,array$params){$control->snippetMode=FALSE;$payload=$control->getPresenter()->getPayload();if(isset($local->blocks)){foreach($local->blocks
as$name=>$function){if($name[0]!=='_'||!$control->isControlInvalid(substr($name,1))){continue;}ob_start();$function=reset($function);$snippets=$function($local,$params);$payload->snippets[$id=$control->getSnippetId(substr($name,1))]=ob_get_clean();if($snippets){$payload->snippets+=$snippets;unset($payload->snippets[$id]);}}}if($control
instanceof
Nette\Application\UI\IRenderable){$queue=array($control);do{foreach(array_shift($queue)->getComponents()as$child){if($child
instanceof
Nette\Application\UI\IRenderable){if($child->isControlInvalid()){$child->snippetMode=TRUE;$child->render();$child->snippetMode=FALSE;}}elseif($child
instanceof
Nette\ComponentModel\IContainer){$queue[]=$child;}}}while($queue);}}}}namespace Nette\Utils{use