PHP code example of wulacms / backend

1. Go to this page and download the library: Download wulacms/backend 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/ */

    

wulacms / backend example snippets


/**
 * @param \backend\classes\DashboardUI $ui
 *
 * @bind dashboard\initUI
 */
public static function initUiI(DashboardUI $ui) {
    $passport = whoami('admin');
    if ($passport->cando('m:api')) {
        $navi          = $ui->getMenu('api', '接口(API)');
        $navi->icon    = '&#xe857;'; // 参考阿里ICON
        $navi->pos     = 900;
        $navi->iconCls = 'layui-icon';

        $doc             = $navi->getMenu('doc', '接口文档');
        $doc->pos        = 1;
        $doc->icon       = 'fa fa-book';
        $doc->iconStyle  = 'color:green';
        $doc->data['url']= App::hash('~rest/doc'); 
    }
}

bind('dashboard\headercss',function(){
    echo '<link rel="stylesheet" href="your/css/file.css"/>';
});

bind('dashboard\headercss',function(){
    echo '<style>body{color:red}</style>';
});

bind('dashboard\footerjs',function(){
    echo '<script type="text/javascript" src="your/js/file.js"/>';
});

bind('dashboard\footerjs',function(){
    echo '<script>var greeting = "Hello World!";</script>';
});