I created the controller ./mysite/code/FileManager.php with the following code…
class FileManager_Controller extends Controller
{
public function upload()
{
echo 'It works!!';
}
}
This works fine when I type http://example.com/filemanager/upload.
And I created the template file themes/simple/templates/FileManager.ss. I want to write the HTML for upload here and it should reflect when I type http://example.com/filemanager/upload. How to do this? Thank you.
Because you’re using a straight controller to handle the request, the system doesn’t know what you want to render or how. When using the CMS and rendering a
Pagethis is usually taken care of for you.So you have to tell it what to render and how. In it’s simplest form this would look something like:
That will render your
FileManager_Controllerclass with theFileManager.sstemplate.