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???
Asked
Active
Viewed 209 times
0

1stthomas
- 731
- 2
- 15
- 22

Ale Van Houtte
- 55
- 1
- 9
-
1Have you read this documentation page? https://documentation.concrete5.org/developers/working-with-pages/single-pages/controllers – Michele Locati Oct 20 '17 at 07:59
-
Hi @MicheleLocati, i did, and at the end ended up doing the single page in the package, but im having some problems rendering the page, basically doesn't show anything... still working on it – Ale Van Houtte Oct 20 '17 at 09:15
-
For speed reasons, concrete5 caches many things: you should try to clear the concrete5 cache when you see something strange. – Michele Locati Oct 20 '17 at 09:55
-
yeah, disabled all cache and using incognito mode just to be sure :P good thing is that is working, so good stuff :D thanks for the help @MicheleLocati – Ale Van Houtte Oct 21 '17 at 13:21
-
@Ale Van Houtte: Did you find a solution or are there still any problems? – 1stthomas Nov 08 '17 at 08:05
-
@1stthomas, at the end i use packages because everything else didn't work. next step is rewrite the whole thing using another framwework :P – Ale Van Houtte Nov 10 '17 at 10:58
1 Answers
1
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.

1stthomas
- 731
- 2
- 15
- 22
-
this solution, for some reason that i can't explain, wasn't working... it was the first attempt but the page didn't reach the controller, so nothing was happening... – Ale Van Houtte Nov 10 '17 at 11:30
-
@Ale Van Houtte: Did you add the single page on the related dashboard page? Cleared the cache? What is the structure of the method call (your form on the single page and the related method to be called in the controller)? It is working on some pages that I made like I wrote on my answer. – 1stthomas Nov 10 '17 at 11:34