dizanu83
(Dijano)
December 24, 2011, 10:11am
1
Hey there, I need help with EReadMore extensions,ok i have a code inside the view
<?php $this->beginWidget(‘application.extensions.EReadMore.EReadMore’, array(
'linkUrl'=>$data->url
));?>
<?php $this->endWidget(); ?>
when i click blog read more i got error 500 Undefined variable: data
(i’m using yii demo blog)
Thank You!
mbtron
(Info)
December 30, 2011, 7:26pm
2
Try this if you make yourself code by the tutorial blog.
<?php $this->beginWidget('application.extensions.EReadMore.EReadMore', array(
'linkUrl'=> '/blog/index.php/post/'. $data->id
)); ?>
<?php echo CHtml :: decode ( $data->content ); ?>
<br />
<?php $this->endWidget(); ?>
But if you copy code from demos blog in download, you can use posted code.
Take a look at:
/**
* @return string the URL that shows the detail of the post
*/
public function getUrl()
{
return Yii::app()->createUrl('blog/post/view', array(
'id'=>$this->id,
'title'=>$this->title,
));
}
in protected/model/Post.php
m3hr
(Mehran)
October 12, 2012, 12:49pm
3
mbtron:
Try this if you make yourself code by the tutorial blog.
<?php $this->beginWidget('application.extensions.EReadMore.EReadMore', array(
'linkUrl'=> '/blog/index.php/post/'. $data->id
)); ?>
<?php echo CHtml :: decode ( $data->content ); ?>
<br />
<?php $this->endWidget(); ?>
hello,
I have a problem with the charset ( utf-8 ).
My blog is in Persian.
In the short part of html the characters is not corect views, but normal page is Ok.
what should I do?
Thanks in advance.
m3hr
(Mehran)
October 13, 2012, 3:33pm
5
Finally I find the way to fix:
just add this:
$html = '<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>' . ob_get_clean();
instead of this:
$html = ob_get_clean();
in the EReadMore file.
finished