Yii Framework Forum: Need help with EReadMore - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Need help with EReadMore need help adding ereadmore.. Rate Topic: -----

#1 User is offline   dizanu83 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 13-December 11

Posted 24 December 2011 - 05:11 AM

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!
0

#2 User is offline   mbtron 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 28-December 11
  • Location:Slovakia

Posted 30 December 2011 - 02:26 PM

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
0

#3 User is offline   m3hr@n 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 29-April 12

Posted 12 October 2012 - 07:49 AM

View Postmbtron, on 30 December 2011 - 02:26 PM, said:

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.
Honesty is best Policy.
www.mrlco.ir
0

#4 User is offline   m3hr@n 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 29-April 12

Posted 13 October 2012 - 05:25 AM

Anyone How answer me???
Honesty is best Policy.
www.mrlco.ir
0

#5 User is offline   m3hr@n 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 29-April 12

Posted 13 October 2012 - 10:33 AM

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
Honesty is best Policy.
www.mrlco.ir
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users