c5 5.7 Single Page Controller Frontend

Permalink 1 user found helpful
Hi everbody

Many times I allready have programmatically created dashboard single pages, but on my first frontend single page I fail. The name off my package is "dna_population" and the single page which I would like to install called "milestones" and is under root in my sitemap. My problem is, the view is in use but the single page controller not.

Package structure:
packages/dna_population/controller.php
packages/dna_population/controllers/single_pages/milestones.php
packages/dna_population/single_pages/milestones.php

My package controller:
<?php
namespace Concrete\Package\DnaPopulation;
use Loader;
use Package;
use SinglePage;
defined('C5_EXECUTE') or die(_("Access Denied."));
class Controller extends Package {
    protected $pkgHandle = 'dna_population';
    protected $appVersionRequired = '5.7.4';
    protected $pkgVersion = '0.0.1';
    public function getPackageName(){
        return t("DNA Population");
    }
    public function getPackageDescription(){
        return t("A package to bundle all helix entries.");


My single page controller:
<?php
namespace Concrete\Package\DnaPopulation\Controller\SinglePage;
use PageController;
use View;
use Loader;
class Milestones extends PageController {
   public function view($id = null, $year = null){
      exit('Test 123');
      die();
   }
}


The single page should be accessible under domain.com/milestones
What do I overlook.

Thanks
Marcus

 
Gondwana replied on at Permalink Best Answer Reply
Gondwana
packages/dna_population/controllers/single_pages/milestones.php

should perhaps be
packages/dna_population/controllers/single_page/milestones.php


Reference:
https://documentation.concrete5.org/developers/working-with-pages/si...
marcusm replied on at Permalink Reply
Hey Gondwana,

that's absolutly right. Thanks a lot!