By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,256 Members | 1,700 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,256 IT Pros & Developers. It's quick & easy.

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

P: n/a
hello all,

is there a function within the HTML_Template_IT 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

<th>Author<img src="{AUTHOR_ARROW_UP}"></th>
<th>Title <img src="{TITLE_ARROW_UP}"></th>
<th>Status<img src="{STATUS_ARROW_UP}"></th>
<th>Etc <img src="{ETC_ARROW_UP}"></th>
<!-- END HEADER -->

when "&order=author", AUTHOR_ARROW_UP will be set to "arrow_on.gif" and
TITLE_ARROW_UP and STATUS_ARROW_UP will be set to "arrow_off.gif".
similarly, when "&order=title", TITLE_ARROW_UP will be set to
"arrow_on.gif" 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.gif".

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

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.