Controllers
Permalink
Hi,
I've created a Page called "reset-password" , that page uses a template called "Basic" and that template I has an area called "content".
The content of that "content area" contains a form.
How do I declare a controller that can access this form ? and to which I could also post the data ?
Thank you for any help or idea
I've created a Page called "reset-password" , that page uses a template called "Basic" and that template I has an area called "content".
The content of that "content area" contains a form.
How do I declare a controller that can access this form ? and to which I could also post the data ?
Thank you for any help or idea
Yes that did the trick, create a single_page and put the template through the view.php in the themes folder, does exactly what I need.
Anyhow, the controller is not called, do you have any clue why ?
the folder structure is the following :
the theme view.php and single_page view.php are correctly rendered however the controller is not called, this is my controller code :
Thnx,
Serge
Anyhow, the controller is not called, do you have any clue why ?
the folder structure is the following :
application -- controllers -- chat -- controller.php -- single_page -- chat -- view.php -- themes -- mytheme -- view.php
the theme view.php and single_page view.php are correctly rendered however the controller is not called, this is my controller code :
Thnx,
Serge
how about:
public function view() {
echo "I'm a controller";
}
public function view() {
echo "I'm a controller";
}
No, it's not the problem, the problem is that the system never calls/executes the file controllers/chat/controller.php
It looks like if Concrete5 would expect the file in another folder
It looks like if Concrete5 would expect the file in another folder
I have single pages set up like so:
application/single_pages/....
application/controllers/single_page/....
application/single_pages/....
application/controllers/single_page/....
hmm, still no effect.
Very very strange, could it be related to the php version ?, I'm using 5.6.10 ?
Serge
Very very strange, could it be related to the php version ?, I'm using 5.6.10 ?
Serge
what happens if you start from scratch, have the controller in the correct place when you register the single page and have the controller with the correct namespace, use statements and it properly extends the page controller class?
still no effect.
namespace Application\Controller\SinglePage; use Concrete\Core\Page\Controller\PageController; class Chat extends PageController { public function view() { echo "hello"; } }
@ses
Here are two examples to try.
Example: named view file (donut.php)
- single page
application\single_pages\donut.php
- single page code
- single page controller
application\controllers\single_page\donut.php
- single page controller code
Example: view file as view.php
- single page
application\single_pages\donut\view.php"
The rest of the steps would be the same as the first example.
Here are two examples to try.
Example: named view file (donut.php)
- single page
application\single_pages\donut.php
- single page code
<h1><?php echo $test; ?></h1>
- single page controller
application\controllers\single_page\donut.php
- single page controller code
<?php namespace Application\Controller\SinglePage; use Concrete\Core\Page\Controller\PageController; class Donut extends PageController { public function view() { $this->set('test', 'test value'); } }
Example: view file as view.php
- single page
application\single_pages\donut\view.php"
The rest of the steps would be the same as the first example.
If that's not enough for you, you should look into Single Pages:http://www.concrete5.org/documentation/developers/5.7/working-with-...