17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2202 Views |
-
access $_SERVER['PATH_INFO']

22 July 2008 at 5:08pm
how do I access $_SERVER['PATH_INFO']?
I getting
Parse error: syntax error, unexpected T_ECHO in /tmp/silverstripe-cache-opt-lampp-htdocs-x3d-web/.cache.opt.lampp.htdocs.x3d-web.themes.blackcandy.templates.Page.ss on line 5 -
Re: access $_SERVER['PATH_INFO']

23 July 2008 at 6:12pm
are you trying to access that from the Page.ss template file? that wouldnt work. You should be able to do something like this..
in Page.php
function Path() {
return $_SERVER['PATH_INFO'];
}then in the template you can call
$Path
-
Re: access $_SERVER['PATH_INFO']

24 July 2008 at 3:16pm Last edited: 24 July 2008 3:18pm
Can I call another .ss file
in the php file?the project I am doing
based on the path_info is what format I send the data as
/html/
HTML/XHML
/wml/
WML
/ajax/
XML or JSON -
Re: access $_SERVER['PATH_INFO']

24 July 2008 at 10:18pm
its a slightly different topic but yes - you can use a method called renderWith()
http://doc.silverstripe.com/doku.php?id=templates&s=renderwith#calling_templates_from_php_code
| 2202 Views | ||
|
Page:
1
|
Go to Top |


