Need help with EReadMore


(Dijano) #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'=&gt;&#036;data-&gt;url


   ));?&gt;

<?php $this->endWidget(); ?>

when i click blog read more i got error 500 Undefined variable: data

(i’m using yii demo blog)

Thank You!


(Info) #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@n) #3

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@n) #4

Anyone How answer me???


(m3hr@n) #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 :P