I’m developing a single page and I want to define my connection just like this page does Accessing the Database to Make Queries
However the __construct triggers the error “Call to a member function getCollectionPath() on null”
Here is my code, stripped down, it’s literally just construct and then render a view, and even then it gives the same error.
<?php
namespace Application\Controller\SinglePage;
use Concrete\Core\Page\Controller\PageController;
use Core;
use Loader;
use Page;
use Concrete\Core\File\File;
class Agenda extends PageController
{
public $app;
public $config;
public function __construct()
{
$this->app = \Concrete\Core\Support\Facade\Application::getFacadeApplication();
$this->config = $this->app->make('config');
}
public function view()
{
$this->render('/agenda/view');
}
}
I’ve made a working __construct() in a block controller and there it worked. So I think it conflicts with PageController. Does anyone know a solution?
Cheers,
Vasco