2017 © Pedro Peláez
 

yii2-extension yii2-helpers

A collection of useful helpers for Yii Framework 2.0

image

yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  • Thursday, August 31, 2017
  • by yidas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 19 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

, (*1)

Yii2 Helpers


Collection of useful helpers for Yii Framework 2.0, (*2)

Latest Stable Version Latest Unstable Version License, (*3)

HELPERS

  • Route
    Validate current route status belonging to the given scope., (*4)

  • RouteJS
    Redirector by JS base calling in Controller, (*5)

  • Navigation
    Web locator saving location and providing validation., (*6)


INSTALLATION

Install from composer command:, (*7)

$ php composer.phar require yidas/yii2-helpers

Or, in yii2 composer.json, manually require yidas/yii2-helpers., (*8)

"require": {
        ...
        "yidas/yii2-helpers": "*"
    },

DOCUMENTATION

Route

Usage: (Supposing the current controller route is 'site/index')

Route::in('site');          // True for site/*
Route::is('site/index');    // True for site/index
Route::get();               // Get such as 'site/index'
Route::getByLevel(1);       // Get 'site' from 'site/index'

// Root Level usage for filtering prefix from route
Route::setRootLevel(1);     // Set the rootLevel to 1
Route::get();               // Get 'index' from 'site/index' 
Route::setRootLevel();      // Get the rootLevel back to 0
Route::get();               // Get 'site/index' from 'site/index'

Example in View:

<ul class="sidebar-menu">
  <li class="<?php if(Route::in('site')):?>active<?php endif ?> treeview">
    <a href="#">SITE MENU</a>
    <ul class="treeview-menu">
      <li class="<?php if(Route::is('site/index')):?>active<?php endif ?>"><a href="<?=Url::to(['site/index'])?>">Menu List</a></li>
      <li class="<?php if(Route::is('site/create')):?>active<?php endif ?>"><a href="<?=Url::to(['site/create'])?>">Add One</a></li>
    </ul>
  </li>
</ul>

RouteJS

Redirect to the route in Controller with JavaScript alert:

public function actionStore()
{
    // Code...
    return RouteJS::redirect(['index', 'status'=>'1'], 'Stroed success!');
}

GoBack to previous page in Controller with JavaScript alert:

public function actionStore()
{
    // Code...
    return RouteJS::goBack('Stroed failed! Return back.');
}

The Versions

31/08 2017

dev-master

9999999-dev https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

09/08 2017

1.2.2

1.2.2.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

04/08 2017

1.2.1

1.2.1.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

12/05 2017

1.4.0

1.4.0.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

16/04 2017

v1.3.0

1.3.0.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

29/11 2016

1.2.0

1.2.0.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

23/11 2016

1.1.0

1.1.0.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

23/11 2016

1.0.1

1.0.1.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities

20/11 2016

1.0.0

1.0.0.0 https://github.com/yidas/yii2-helpers

A collection of useful helpers for Yii Framework 2.0

  Sources   Download

BSD-3-Clause

extension yii2 bootstrap helper yii utilities