posted by aryo tejo w on September 8, 2016

The blog creation phase with the framework (Yii), is to add an extension to simplify article writing. In this blog is used editMe extension. One of the advantages is able to upload image files (in our PC) to be inserted in the article. When the article has been posted, it appears the drawback, the article will look entirely along with the inserted image.
It is less efficient in terms of, the speed of web display. Every internet browser opens, in fact, will also download the files and images that look, meaning it will be lavish pulse :) and also slow when displaying web pages.


One way is to add procedures on the web, so in the article can be inserted more markers. Here is his script:

public function moreLink($idnya,$isinya)
    {
       $hasil="";
       
        if(strstr($isinya, '<more>', true)==false)
        { $hasil= $isinya; }
       else
        {
            $hasil=strstr($isinya, '<more>', true);
            $hasil= $hasil.$isilink='<a href="../post/'.$idnya.'">SELENGKAPNYA</a>';
        }
        
       return $hasil;
    }

Every article that appears on the web page will always be truncated, precisely limited by the visible text, in accordance with the writing of "more" in the article itself. The series of articles will end with the words COMPLETE and when we click on the writing INSTANTLY it will lead to the article in full and eliminate the word COMPLETE earlier. Here's the coding:

public function tanpaMore($isinya)
    {
       
       $hasil="";
       $hasil=str_replace("&lt;more&gt;","" , $isinya);
       return $hasil;
    }


 

Leave a Comment

Fields with * are required.

Please enter the letters as they are shown in the image above.
Letters are not case-sensitive.