5415 Posts in 1651 Topics by 1188 members
|Go to End|
14 October 2013 at 10:02am Last edited: 14 October 2013 10:03am
I'm trying to create a static page with some customization in it.
In my ProjectPage.php i have:
class ProjectPage_Controller extends Page_Controller
$name = 'BLAH';
echo '<a href="http://example.com/php/test.php?name='.$name.'">link</a>';
And in my ProjectPage.ss i have something like:
The problem is the function is called BEFORE everything else (ie. before <html>) & not at the point between the divs.
Can anyone help as to why?
14 October 2013 at 6:23pm
I'm not sure on the full template processing pipeline but HTML is not genreated procedurally. Functions are processed then the HTML is genereted so if you want a function to output a value into the template at it's insertion point you need to use return instead of echo.
return '<a href="http://example.com/php/test.php?name='.$name.'">link</a>';
14 October 2013 at 6:30pm
|Go to Top|