Page type controller doesn't run

I’m following the docs for custom page type controllers and it’s not working: Controllers for Page Types :: Concrete CMS

It says to make this file: application/controllers/page_types/blog_entry.php. I name mine gallery.php because my custom page type uses the handle “gallery”. I name the class Gallery. The docs say this class should be in the \Concrete\Controller\PageType namespace but the sample code uses the Application\Controller\PageType namespace. I don’t know which namespace I should use so I tried both. I tried creating the directories and class file inside my package, inside my theme (which is inside my package) and inside the top level application directory. None works. The view() method is never called. I added an __construct() just to see if the class is ever instantiated and it isn’t.

Anyways, assuming this did work, what do I do with it? The docs say “any data it [view() method] sets will be available in the page’s template” but it doesn’t say how that data would be set. From my debugger I can see that my template file has a PageView object, and HTML service object. What are these objects? What is $scopeItems? I’ve browsed through the theme docs and see nothing about these.

Hi A couple questions so people can help you troubleshoot better. Are you working in V9 and what version of php are you using?

concrete 9.1. PHP 8.1