Cakephp link to view a page in sub folder

268 views Asked by At

I wish to display a normal page in a sub-dir of the Pages folder, however cakephp keeps removing the "/" forwardslash and replacing it with "%2F".Ive tried to add the escape=>false flag but it doesnt seem to work. What am i doing wrong?

my code;

        echo $this->Html->link('Tiny MCE plugin',array(
        'controller'=>'pages',
        'plugin'=>false,
        'action'=>'display','testtinymce/testtinymce'
        ),array('escape' => false));

i.e the "testtinymce.ctp" file is a sub folder of "Pages" called "testtinymce"

app\View\Pages\testtinymce\testtinymce.ctp

It keeps producing; pages/testtinymce%2Ftesttinymce as the link

1

There are 1 answers

0
ndm On BEST ANSWER

If you want to genereate multiple path segments, then you have to pass them as separate values, like

echo $this->Html->link('Tiny MCE plugin', array(
    'controller' => 'pages',
    'plugin' => false,
    'action' => 'display',
    'testtinymce',
    'testtinymce',
    // ...
));

See also Cookbook > Development > Routing > Passed Arguments