concrete 5 5.7.5.2 single page controller

217 Views Asked by At

I have a single page with a form (located in application/single_pages/my_single_page), what I want to do is very simple, on submission I want to send an email. So far I can show the single page and the form. Then I put the controller in application/controllers/controller.php but this didn't work. So then I added application/controllers/single_page/controller.php and neither then some other combinations, but it seems it is not the right way to do it. I can't find much information online, any help???

1

There are 1 best solutions below

2
1stthomas On

Assuming your page lays under the root page and has the name my_single_page the single_page needs to be placed on application/single_pages/my_single_page as you noticed. Then you need a controller under application/controllers/single_page with the filename: my_single_page (which looks like: application/controllers/single_page\my_single_page.php). This controller needs the following base structure:

<?php
namespace Application\Controller\SinglePage;

use PageController;

class MySinglePage extends PageController
{
    // Your code
}

This should do the trick.