Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2010-07-02 06:55:10

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Parsing php in section pages

JanDW wrote:

Where am I messing up this time? sigh
Thanks in advance.

You need to access the global from the global scope. The variable is not accessible inside the function. For example:

<txp:php>
	global $dtstart; /* Back in the biz */
	echo $dtstart;
</txp:php>

Or using the $GLOBALS superglobal array which contains all the variables defined in the global scope:

<txp:php>
	echo $GLOBALS['dtstart'];
</txp:php>

Offline

#17 2010-07-02 12:37:37

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: Parsing php in section pages

ah, thanks for making me understand, guys.


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

Board footer

Powered by FluxBB