I've got a view with a formular (which isn't created with the form helper). For example, I have CakePHP installed in a folder called 'myfolder1'.
So my formular starts with that line:
<form id="ctrlAddForm" method="post" action="/myfolder1/ctrl/add" accept-charset="utf-8">
But if I rename the root folder, I have to edit all formulars (2 yet). Is there any constant or function which represents the root directory / name?
I've read about the constant ROOT. Should I use that variable?
Solution
basename(ROOT)
.You can use the HTML Helper function url(). For example in the action attribute of the form tag:
$this->Html->url(array('controller' => 'ctrl', 'action' => 'add'));
Well, you could try this normal ol' PHP function: basename
basename(APP);
Since that doesn't work I actually opened up my own Cake install. Try this:
basename(dirname(APP));