A simple extension to shorten an html code. - version 1.0 - author Dimitrios Mengidis tydeas.dr@gmail.com
This a common functionality found in blogs, where you see a part of an article and there is link usually named read more where get redirected to the full article. As an example you can check my blog.
In the view add:
$this->beginWidget('application.extensions.EReadMore.EReadMore', array( 'linkUrl'=>$data->url )); <div> <h1>EReadMore</h1> <p>A simple extension to shorten an html code.</p> <h2>Requirements</h2> <ul> <li><a href='php.net/manual/en/intro.dom.php' >DOMDocument</a></li> </ul> </div> <?php $this->endWidget();
Check the EReadMore code options to see what you can set.
Total 4 comments
for urgent solution to meet my need I make a read more with very simple php code strip_tags and substr
demo : www (dot) lowongankerja (dot) dewatatech (dot) com
I manage to use this the "old fashion" way by using this code instead
utf works ok and there's no need to use extensions. But still there's the problem with the cuts inside some tags like "ul". But it works.
For this to work for a certain number of chars I'm using this, but still can't work around utf, any ideas?
After a few more tests i found out that this is actually working.
but the utf characters are not properly shown. Any ideas?
Leave a comment
Please login to leave your comment.