cakephp - HTMLHelper link() added unintended path -


i believe simple question. maybe that's why can't find on google.

when inside view/product/view.ctp

echo $this->html->link('download pdf', 'app/files/product/1/manual.pdf'); 

the resulting url this:

app/products/app/files/product/1/manual.pdf 

it automatically added app/products since inside product's view.

how nullify automatic addition?

thanks

you're specifying relative url, causing browser append url current url.

echo $this->html->link('download pdf', '/app/files/product/1/manual.pdf'); 

(note leading slash /)

should result in link http://example.com/app/files/product/1/manual.pdf


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -