PHP Classes

File: src/Tools/ModuleGeneratorEnhanced/tests/test-dashboard.php

Recommend this page to a friend!
  Packages of Adrian M   upMVC   src/Tools/ModuleGeneratorEnhanced/tests/test-dashboard.php   Download  
File: src/Tools/ModuleGeneratorEnhanced/tests/test-dashboard.php
Role: Example script
Content type: text/plain
Description: Example script
Class: upMVC
Pure PHP web development without other frameworks
Author: By
Last change:
Date: 2 months ago
Size: 810 bytes
 

Contents

Class file image Download
<?php
/**
 * Test dashboard module generation
 */

require_once __DIR__ . '/../../../../vendor/autoload.php';

use
App\Tools\ModuleGeneratorEnhanced\ModuleGeneratorEnhanced;

echo
"=== Testing Dashboard Module ===\n\n";

$config = [
   
'name' => 'TestDashboard',
   
'type' => 'dashboard',
   
'use_middleware' => true
];

try {
   
$generator = new ModuleGeneratorEnhanced($config);
    if (
$generator->generate()) {
        echo
"? Dashboard module created successfully!\n";
        echo
" Location: src/Modules/TestDashboard/\n";
        echo
" View template: views/dashboard.php\n\n";
        echo
"? Next: Run 'composer dump-autoload'\n";
        echo
"? Test: http://localhost/upMVC/public/testdashboard\n";
    }
} catch (
Exception $e) {
    echo
"? Error: " . $e->getMessage() . "\n";
}