RE: Custom Open Tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think there's a way to redefine what tag PHP uses, but I think it
globally resets it.  I don't think you can say "use <!blah !> and also
use <?php ?>".  I think that setting is in PHP.INI somewhere.

It might be easier to change your "to be executed later" php tags to
something else and before it's sent to it's final destination, do a
string replace to change the tags.


If you have two different servers, you might go into PHP.INI and set the
following tag on the last server and turn it OFF on the first server:

; Allow ASP-style <% %> tags.
asp_tags = Off


I'm not sure, but that may allow you to use <?php ?> AND <% %> tags at
the same time.



All in all, I think I'd try to find a better way than using two kinds of
tags and trying to jury-rig PHP to only execute some of it.


Even if it meant using a conditional on the tags to be executed later
"if (!$finalexecute) ..."  and just change that value at the top of your
code or something.


Sounds messy all around, but there seem to be a number of ways you could
possibly do this.

-TG

> -----Original Message-----
> From: Sven Schwyn [mailto:echo36@xxxxxxxxxxx] 
> Sent: Wednesday, December 01, 2004 4:16 PM
> To: php-general@xxxxxxxxxxxxx
> Subject:  Custom Open Tags
> 
> 
> Hi folks
> 
> Does anybody know whether there's a way to tell PHP to accept an 
> alternative open tag like for instance <?mytag or <?mc along with the 
> normal <?php tag?
> 
> I'm looking for a way to have two kinds of PHP code in a page. The 
> first kind tagged <?mc ... ?> contains the PHP code to manage page 
> elements (like includes, menus etc) while the second kind 
> tagged <?php 
> ... ?> contains normal PHP code for dynamic pages (like DB stuff). A 
> page resides on the Staging (Virtual) Host and contains both kind of 
> tags. When viewing the page on the Staging Host, both open tags are 
> executed. Yet when publishing a page to the Production 
> (Virtual) Host, 
> the mc-tags are executed (and thus complete the page design) 
> while the 
> php-tags are left untouched (as they contain the dynamic 
> stuff). Sounds 
> more complicated than it is :-)
> 
> Thanks for your hints,    -sven
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux