PHOCOA PHP Framework

Dynamic Hiding of Elements and their Context

While all UI widgets support a "hidden" attribute that causes them to not be rendered, sometimes there is supporting HTML that surrounds the widget that also needs to be hidden. This is particularly common when optionally including data in a table, where you might want to exclude an entire row if a piece of data is missing.

Toggle Visibility: Show Hide

Simple Example

This example hides a table row if the "name" field is hidden.

Name: Alan
City: Memphis

Code:


<table border="0" cellspacing="0" cellpadding="3">
    {WFViewHiddenHelper id="name"}
    <tr>
        <td valign="top" align="right">Name:</td>
        <td valign="top">{WFView id="name"}</td>
    </tr>
    {/WFViewHiddenHelper}
    <tr>
        <td valign="top" align="right">City:</td>
        <td valign="top">{WFView id="city"}</td>
    </tr>
</table>


Dynamic Example

WFViewHiddenHelper also works with WFDynamic's. This example hides "Alan" and "David".

  • Alan
  • Bob
  • David
  • Chris

Code:


<ul>
{section name=items loop=$__module->valueForKeyPath('People.arrangedObjectCount')}
    {WFViewHiddenHelper id="listName"}<li>{WFDynamic id="listName"}</li>{/WFViewHiddenHelper}
{/section}
</ul>


Examples

Cookbook
  Widgets
  Bindings
  Pagination
  Formatters

Basic Examples
  Email
  Skin Browser
  Forms
  Regex Tester

AJAX Examples
  Infrastructure

  (YUI Examples)
  AutoComplete
  ColorPicker
  Menu
  Tree View
  Tab View
  Container

Appcelerator Integration
  Demo
Copyright (c) 2017 Alan Pinstein. All Rights Reserved.