GithubHelp home page GithubHelp logo

yii2-eruda's Introduction

Console for Mobile Browsers based on Eruda.

More info & Demo

Visit Eruda github site.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require "tomsh-hr/yii2-eruda:*"

or add

"tomsh-hr/eruda": "*"

to the require section of your composer.json.

Usage

Put this code in your main template:

<?php tomsh\eruda\Eruda::widget(); ?>

Configuration

To configure eruda js put options in clientOptions like this:

<?php tomsh\eruda\Eruda::widget([
    'clientOptions' => [
        'container' => 'erudaElement', // ID of an element (this is not same as in eruda configuration)
        'tool' => ['console', 'elements']
    ],
    'onlyByUrl' => false, // Optional, default true
    'urlGetter' => 'eruda', // Optional, default 'eruda'
    'onlyInDev' => false // Optional, default false
]); ?>

NOTE: container configuration option accepts element id and not js object like in eruda original configuration. For other configuration options visit eruda documentation.

Widget options

Name Type Desc
onlyByUrl boolean Load eruda script when url parameter is passed. Example http://domain/?eruda=true
urlGetter string Url parameter to look. Default 'eruda'
onlyInDev boolean Load eruda only in development environment

onlyByUrl (default: false)

The JavaScript file size is quite huge(about 100kb gzipped) and therefore not suitable to include in mobile pages. It's recommended to load eruda only when eruda is set to true on url(http://domain?eruda=true). Set this to true if you want to load script when url parameter is passed.

urlGetter (default: 'eruda')

Change url parameter to look for. Ex. put 'console' and than go to url(http://domain?console=true)

onlyInDev (default: false)

If you set this to true eruda script will be loaded only in development environment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.