So I’m working on a CakePHP app, and had this line in one of my controllers:
$this->render('/vids/index');
It was working fine in MAMP. But on my live site (on MediaTemple) the controller couldn’t find the view. After nearly pulling my hair out, I changed the line to this:
$this->render('/Vids/index');
And it worked.
Zuh? What could account for one system being case sensitive, and another not? My assumption is that this isn’t a Cake issue, but I’m so baffled, I have no idea what’s causing the discrepancy.
Simply because the 2nd line (uppercase Vids) is correct for a 2.0 app. And I guess there are differences between OSX (guess that from you using MAMP) and the servers OS you deploy the app on.
And why do you call render() manually? If you access /vids from the web it should automatically route to VidsController::index() and the controller will auto pick the right view.
Stands Vids for videos? Thats a horrible name. Abbreviations in code suck hard, if you want to rely on /vids for the URL use the router to rewrite that url.