473,699 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTML_Template_I T 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

<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>
<!-- 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

Jul 17 '05 #1
0 1203

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: nick7001 | last post by:
Hi all, I am using the HTML_Template_IT package. I would like to use a template something like below. <!-- BEGIN TOPIC --> <h1>{TITLE} ....{TOPLINK}...</h1> {TOPIC-TEXT} <!-- END TOPIC -->
by: pertheli | last post by:
I am in a situation where only "goto" seems to be the answer for my program logic where I have to retry calling some repeated functions. Can anybody help in the usage of goto and its effect in local variables, as shown in the stripped code below void MyClass:Process(){ int iMaxRetry = 100;
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document #1, very application-like, must include the JS file for this library of functions. One reason is that it must call a function to name a "callback" function, and within its own script block, must define the callback function. The callback handles...
by: Abubakar | last post by:
Hi all, The variables declared inside try block cant be accessed inside its corresponding finally block. When I used to explain finally concept to anyone I would usually tell them (briefly) that the finally block is existing there cuz of the logic inside try block, if try is not there finally wont be there. If try and finally are so closely related than finally should share the scope of try. Please explain the rational behind this scope...
by: Anoj | last post by:
Hi All, As you all know in vb.net we can declare block level variables. Like : Dim I As Integer For I = 1 To 3 Dim N As Long ' N has block scope in VB.NET N = N + I Next
by: | last post by:
Is it possible to define a variable in a block in order to make it invisible outside that block? For example, in C I can write { int a .... } then a will only be available inside the curley brackets
by: Madhav | last post by:
Hi all, I did not understand why do the global vars are initialized to NULL where as the block level variables have random values? I know that the C standard requires this as was mentioned in a recent thread. I want to know why this descrimination is in place. Can't all the variables be initialised to NULL automatically by the compiler? This would make programming a little easier.
by: noridotjabi | last post by:
Whilest I was browesing a tutorial today I came across the infromation that in standard C variables must be decalred at the beginning of a block. Meaning: /****************************************************/ /* ... usual includes and such */ int var = 1; if(var = 1){ printf("hello world\n");
by: Clausfor | last post by:
Hello, I have a problem with restoring variables in the setjmp/longjmp functions: K&R2 for longjmp says: "Accessible objects have the same value they had when longjmp was called, except for automatic non volatile variables of the function invoking setjmp, these will be undefined if modified after the setjmp call"
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.