open Pdf file with CHtml:link

hi, i have a pdf file in assets/uploads/documents folder, i want to make a like that will open pointed pdf in new window, my code is as follow :


CHtml::link(CHtml::encode($model->ApplicationDocument ),array(Yii::app()->baseUrl . '/assets/uploads/documents/'.$model->ApplicationDocument))

this produce link :


localhost/mywebsite/index.php?r=mywebsite/assets/uploads/documents/1301145326d2ovc.pdf

instead of :


localhost/mywebsite/assets/uploads/documents/1301145326d2ovc.pdf

what i m missing :unsure:

waiting for reply…

Second parameter should be a string instead of an array:

[size="3"][color="#660066"][size="2"][size="3"][color="#000000"][size="3"]


CHtml::link(CHtml::encode($model->ApplicationDocument), Yii::app()->baseUrl . 'assets/uploads/documents/' . $model->ApplicationDocument)

[/size][/color][/size][/size][/color][/size]

it works :) Thanks a lot.

You guys are awesome.

What should I need to do if I want to open that pdf in a new tab ??

it works :) Thanks a lot


CHtml::link(CHtml::encode($model->ApplicationDocument), Yii::app()->baseUrl . 'assets/uploads/documents/' . $model->ApplicationDocument,array('target'=>'_blank')