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
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
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
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
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
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