Single page controller
Permalink
I have created a single page. But the controller does not fire. This is how I added the name space
[code}<?php
namespace Concrete\Package\ServiceTicketingSystem\Controller\SinglePage\Tickets;
use \Concrete\Core\Page\Controller;
use Loader;
use UserIfo;
use User;
class TicketsController extends Controller { [/code]
my single page lives in pkg/single_pages/tickets/tickets.php.
What am I doing wrong?
[code}<?php
namespace Concrete\Package\ServiceTicketingSystem\Controller\SinglePage\Tickets;
use \Concrete\Core\Page\Controller;
use Loader;
use UserIfo;
use User;
class TicketsController extends Controller { [/code]
my single page lives in pkg/single_pages/tickets/tickets.php.
What am I doing wrong?
I believe the class name should be Tickets instead of TicketsController.
Andrew my controllers name is controller . should I rename it to tickets ?its Still not firing. I have created many dashboard single pages with no issues. its just now when creating a regular single page with a controller that it dose not seem to work. on_start and view do not fire. the single page installs through the package just fine with no errors. This has got me really scratching my head.
i have change it several times from view - controller as the file names, and ticket - tickets each time i removed then reinstalled the package. The view page loads fine when named view, but gives me a blank page when using the name tickets for the file name. anytime i changed the name I uninstalled then reinstalled the package, and every time the page installed with no apparent errors.
i have change it several times from view - controller as the file names, and ticket - tickets each time i removed then reinstalled the package. The view page loads fine when named view, but gives me a blank page when using the name tickets for the file name. anytime i changed the name I uninstalled then reinstalled the package, and every time the page installed with no apparent errors.
I think I would try making the single page named "tickets.php" and the controller named "tickets.php" and making sure that the class name is "Tickets" (without the Controller) in the class name.
Andrew,
No love ! I created another install of 5.7.3 just to make sure I had not hosed anything up.
If I create the single page and controller with the names you suggested(which is what i had done originally) all I get is a blank page(only header and footer). If I use the name view for the single page and controller for the controller, the view loads but never fires the controller. Can you try this on your end to see if you can reproduce the error. No error is ever reported.
tony
No love ! I created another install of 5.7.3 just to make sure I had not hosed anything up.
If I create the single page and controller with the names you suggested(which is what i had done originally) all I get is a blank page(only header and footer). If I use the name view for the single page and controller for the controller, the view loads but never fires the controller. Can you try this on your end to see if you can reproduce the error. No error is ever reported.
tony
Hey! Did you ever get any progress on this? Having exact same issue, everything should be working but for whatever reason controller code doing nothing
I don't know how it works in 5.7, but in 5.6 you had to be very particular about how you name both the controller and its associated view (single_page). I would have hoped this would be cleaned up in 5.7 with the new routing system, but perhaps it wasn't...
So try changing the name of your "view" (single_page) file from /single_pages/tickets/tickets.php to /single_pages/tickets/view.php (or /single_pages/tickets.php -- not inside a subdirectory).
Note that if you already installed the package with the old directory structure, you'll need to uninstall it and clean things up (delete the single_page from the sitemap if it's still there), then reinstall the package.
So try changing the name of your "view" (single_page) file from /single_pages/tickets/tickets.php to /single_pages/tickets/view.php (or /single_pages/tickets.php -- not inside a subdirectory).
Note that if you already installed the package with the old directory structure, you'll need to uninstall it and clean things up (delete the single_page from the sitemap if it's still there), then reinstall the package.
Agree with jordanlev that the class should be: Tickets
Also the namespace and use statements don't look right. Try this:
Also the namespace and use statements don't look right. Try this:
<?php namespace Concrete\Package\ServiceTicketingSystem\Controller\SinglePage; use \Concrete\Core\Page\Controller\PageController; use Loader; use UserIfo; use User; class Tickets extends PageController