Al1
Al1

Reputation: 71

How can I render CamelCase-named view in CakePHP 1.3?

I have a little trouble with naming convention in CakePHP 1.3. I've element called storeItem.ctp, when I'm trying to call it from another view - it works perfect, but when I'm trying to use it as view for action($this->viewPath = 'elements'; and then $this->render(null, 'ajax', '/canvas/storeItem');) I'm getting the error: Error: Confirm you have created the file: ***views/elements/canvas/store_item.ctp. How can I fix it without renaming element?

Upvotes: 0

Views: 169

Answers (1)

tmazur
tmazur

Reputation: 173

An explanation why your code does not work as expected is written in the second paragraph from the bottom in the cookbook. You should try it this way:

$this->layout = 'ajax';
$this->render('/elements/canvas/storeItem');

Upvotes: 3

Related Questions