2017 © Pedro Peláez
 

yii2-extension yii2-back2top

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

image

walter74/yii2-back2top

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

  • Thursday, October 5, 2017
  • by walter74
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Back to top button

A simple widget button to use to go back to the top of the page, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

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

or add, (*4)

"walter74/yii2-back2top": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

<?= \walter74\back2top\Back2Top::widget(); ?>

You can configure several custom attributes which are set by default as follow :, (*7)

 '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'=>'<div id="{{id_widget}}" class="{{class_tag}}" style="{{style_tag}}"><span class="{{class_icon}}"></span>{{title}}</div>'

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

<?= \walter74\back2top\Back2Top::widget(['title'=>'go up','class_icon'=>'glyphicon glyphicon-arrow-up']); ?>

it's possible even to inject your custom code or style rather than the default configuration, by passing through js and css respectevely since both two are set as null by default: js=>null css=>null, (*9)

Once you've modified the code, new code will be registered as init() function will be called., (*10)

The Versions

05/10 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by walter cosentino

extension yii2 widget back2top