HTML_Template_IT getVariable -- get all variables in the current block?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bettyann@campbell.com

    HTML_Template_IT getVariable -- get all variables in the current block?

    hello all,

    is there a function within the HTML_Template_I T package that can get
    all variables in a current block? sort of the opposite of what
    $template->setVariable does, ie, perhaps a getVariable?

    i have a template that defines a table. the header columns will
    include an image that will be the same for all columns except for the
    column specified by the "&order=colName " specified in the predefined
    variable $_SERVER['REQUEST_URI']. something like this simplified
    example:

    <!-- BEGIN HEADER -->
    <tr>
    <th>Author<im g src="{AUTHOR_AR ROW_UP}"></th>
    <th>Title <img src="{TITLE_ARR OW_UP}"></th>
    <th>Status<im g src="{STATUS_AR ROW_UP}"></th>
    <th>Etc <img src="{ETC_ARROW _UP}"></th>
    </tr>
    <!-- END HEADER -->

    when "&order=author" , AUTHOR_ARROW_UP will be set to "arrow_on.g if" and
    TITLE_ARROW_UP and STATUS_ARROW_UP will be set to "arrow_off.gif" .
    similarly, when "&order=tit le", TITLE_ARROW_UP will be set to
    "arrow_on.g if" and AUTHOR_ARROW_UP and STATUS_ARROW_UP will be set to
    "arrow_off.gif" . and so on for "&order=status" .

    i thought a good way to set XYZ_ARROW_UP would be to loop thru all
    ..*_ARROW_UP variables and set them all to "arrow_off.gif" . then i
    could set just &order=xyz to "arrow_on.g if".

    i could create an array of *_ARROW_UP names, but i thought my PHP code
    would be more robust if i could query all variables in the current
    block "HEADER" and loop thru that list. this way i would not have to
    modify my PHP code if i added a new column to the template. is this
    possible? is there a better way to do this?

    thanks for any suggestions.
    - bettyann

Working...