I have a question that hopefully someone can help with.. I am looking for a way to integrate some custom php/mysql scripts that I have to pull info from a database and display onto a page created by Silverstripe. To give a little background on the project, I've got a database with a bunch of store locations listed in it. I have a php script written to grab the states and display a list of the states, then when a state is clicked on it shows a list of cities, a city is clicked on and it shows the stores in that city. How would i go about creating a page/pages with the same similar functionality to it?
Any info or tips would be greatly appreciated. I am sure Silverstripe is capable at doing this, I'm just not sure how to go about it.
Ok, I created a CustomPage.php file and put that code inside of it, then created a CustomPage.ss file, and also created a file in mycode/custom.php. I put a function in that file that is just echo'ing out a string of text. When I go into the admin section and create a new custom page, everything shows up fine, but the string of text it is echo'ing out is being shown at the very top left of the page. I am just playing with the tutorial site right now and here is how i am displaying the content with the CustomPage.ss in the layout folder.
I put a function in that file that is just echo'ing out a string of text.
So when the parser is parsing the file it will probably be getting to that function for some reason and echoing it. Rather then having your custom method echoing it, just return "the string" - the template parser will do all the echoing you need.