I decided to try and parse the record and convert it to a Yii link, but it won't create a link on output. i'm not sure what is wrong since the output is exactly the correct syntax. I would really appreciate some help on this.
Here is the data:
{link_url}solutions/tab1{/link_url}{link_title}Linker{/link_title}
I then parse it with this code. it's not very efficient yet, but it works:
class PortletColumn1 extends Portlet
{
protected function renderContent()
{
$link = "<a href=\'".Yii::app()->homeUrl."?r="; //set the prefix for yii format link
// parse the "link_url" data
$string = Yii::app()->RCnar->getContent('frontPage_column1');
$regex = "#([{]link_url[}])(.*)([{]/link_url[}])#e";
$content = preg_replace($regex,"('$link$2\'>')",$string);
//parse the "link_title" datta
$string = $content;
$regex = "#([{]link_title[}])(.*)([{]/link_title[}])#e";
$content = preg_replace($regex,"('$2</a>')",$string);
$this->render('portletColumn', array('content'=>$content, 'type'=>'raw'));
}
}
Here is the parsed output:
<a href='http://www.mydomain.com?r=solutions/tab1'>Linker</a>
Here is the view file:
<?php echo "$content";?>
Here is the browser output:
[color=#6B6B6B]<a href='http://www.mydomain.com?r=solutions/tab1'>Linker</a>[/color]
Any ideas to why it won't create the link?