I have created a data-link in cgridview using CHtml::link, which should be redirected to images present in "images" folder.
But the images folder is outside the protected folder, so how can I change the url:
What I get: localhost/adi/index.php?r=images/imagename.png
What I need: localhost/adi/images/imagename.png
Keith
(Kburton)
2
$imageUrl = Yii::app()->baseUrl . '/images/imagename.png';
$link = CHtml::link('Link Text', $imageUrl);
iam getting url configration problem inner pages are not displaying it is showing Link/pub/index.php
<li <?php echo ($data->permalink == ‘about’) ? ‘class=“current-menu-item”’ : ‘’ ?>><a href="<?php echo Yii::app()->createUrl(‘about’) ?>">About Majestic Xpress</a></li>
‘urlManager’ => array(
'urlFormat' => 'path',
'rules' => array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
'gii'=>'gii',
'gii/<controller:[\w\-]+>'=>'gii/<controller>',
'gii/<controller:[\w\-]+>/<action:\w+>'=>'gii/<controller>/<action>',
‘gii/<controller:\w+>/<id:\d+>’ => ‘/view’,
'gii/<controller:\w+>/<action:\w+>/<id:\d+>' => '/',
'gii/<controller:\w+>/<action:\w+>' => '/',
'signin' => 'site/login',
'signup' => 'site/signup',
'news' => 'content/news',
'news/<slug:[A-Za-z0-9-]+>' => 'content/newsItem',
'contact' => 'site/contact',
'search' => 'site/search',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'pages' => 'Content/redirect',
//'import-duty-calculator'=>'site/calculator',
'svg-customs-duty-calculator'=>'site/calculator',
'faq'=>'Content/faq',
'<url:[A-Za-z-]+>' => 'Content/render',
'email/verify/<id:[A-Za-z0-9-]+>'=>'site/verify',
'user/verify/<id:[A-Za-z0-9-]+>' => 'user/verify',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
'showScriptName' => false,
),