0

I've never had problems with CakePHP's theming system in the past, but now, errors galore. My main issue is that all theme resources (those in /app/views/themed/MyTheme/webroot/*) fail to load. I've set up a custom AppController in /app to set the theme.

var $view = "Theme";
var $theme = "MyTheme";

When I go to any page, I can see that it's utilizing my theme's default.ctp layout and the HTML is fine. Any and all page resources, CSS, JavaScript, images, anything in the theme webroot, fails to load and instead gives me an error like the following (let's say I tried to access http://example.com/theme/MyTheme/img/bg.png):

Error: ThemeController could not be found.

Error: Create the class ThemeController below in file: app/controllers/theme_controller.php

<?php
class ThemeController extends AppController {

    var $name = 'Theme';
}

I've never received an error like this in my time with CakePHP. I'm running the latest stable version at 1.3.7.

Kevin Mark
  • 1,671
  • 1
  • 21
  • 49

1 Answers1

1

I've finally found a solution. CakePHP didn't like my uppercase theme name. In fact, any theme name that I tried that included uppercase characters failed to work. I changed my folder name and internal theme name from "MyTheme" to "my_theme" and it worked perfectly. Could possibly be a bug, but it could be undocumented, yet expected functionality.

Kevin Mark
  • 1,671
  • 1
  • 21
  • 49
  • its not a bug, thats cakes conventions. all folders and files should always be lower-case underscored – dogmatic69 Feb 06 '11 at 13:12
  • @dogmatic69, I'm completely familiar with Cake conventions. I tried using "my_theme" while using $theme = "MyTheme" but it failed to work. This is probably a server issue. In fact, after I replaced Cake and (almost) started from scratch everything started working. Again, probably an ID10T. – Kevin Mark Feb 06 '11 at 20:17