PHPackages                             walter74/yii2-back2top - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. walter74/yii2-back2top

ActiveYii2-extension

walter74/yii2-back2top
======================

A simple widget button to use to go back to the top of the page

17PHP

Since Oct 5Pushed 8y ago1 watchersCompare

[ Source](https://github.com/walter74/yii2-widgets)[ Packagist](https://packagist.org/packages/walter74/yii2-back2top)[ RSS](/packages/walter74-yii2-back2top/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Back to top button
==================

[](#back-to-top-button)

A simple widget button to use to go back to the top of the page

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist walter74/yii2-back2top "*"

```

or add

```
"walter74/yii2-back2top": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```

```

You can configure several custom attributes which are set by default as follow :

```
 'id' =>"toTop"
 'class_tag' => 'btn btn-info'
 'style_tag'=>'display: block;'
 'position_bottom'=>'100px;'
 'position_right'=>'10px;'
 'title=>'Back To Top'
 'class_icon'=>'glyphicon glyphicon-chevron-up'
 'template'=>'{{title}}'

```

if you want to change these settings, you've to pass new value by widget config as the example showed below:

```
