PHP code example of yidas / yii2-helpers

1. Go to this page and download the library: Download yidas/yii2-helpers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yidas / yii2-helpers example snippets


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'

<ul class="sidebar-menu">
  <li class=" if(Route::in('site')):

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

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

$ php composer.phar