Ok, now you have an application running with Yii framework ! You can now benefit from the large amount of extensions provided by the Yii community. But what’s an extension ?
There are many ways to extend Yii : modules, components, helpers….but we are going to focus on one. yes, one step at a time please !
And to better understand it, just go to the Yii Framework website and download this extension.
It’s a little scroll to top using jquery. Il will appear on the bottom right of your browser just to get, beautifully and smoothly, to the top.
We are going to use that feature in our main layout so the whole site would benefit from it.
Just unzip the archive in the protected/extensions folder. The result will be protected/extensions/scrolltop
You now just have to add the code to your layout main.php page.
copy this before the ending html tag.
$this->widget('ext.scrolltop.ScrollTop', array( //Default values 'fadeTransitionStart'=>10, 'fadeTransitionEnd'=>200, 'speed' => 'slow' ));
Now check the result in your browser.