PHP code example of fabiodoppio / mvc

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

    

fabiodoppio / mvc example snippets




pp::config([
    "APP_URL"           => "https://",              // [REQUIRED] url to your app, no trailing slash
    #"APP_NAME"         => "My App",                // [OPTIONAL] name of your app
    #"APP_TITLE"        => "",                      // [OPTIONAL] title of your start page
    #"APP_AUTHOR"       => "",                      // [OPTIONAL] author of your app
    #"APP_DESCRIPTION"  => "",                      // [OPTIONAL] description of your app
    #"APP_LANGUAGE"     => "en_EN.utf8",            // [OPTIONAL] (server-)language of your app
    #"APP_LANGUAGES"    => [],                      // [OPTIONAL] available (server-)languages
    #"APP_CRON"         => false,                   // [OPTIONAL] de/activates cronjob
    #"APP_LOGIN"        => true,                    // [OPTIONAL] de/activates login (except admins)
    #"APP_SIGNUP"       => true,                    // [OPTIONAL] de/activates signup
    #"APP_MAINTENANCE"  => false,                   // [OPTIONAL] de/activates maintenance mode (except admins)
    #"APP_BADWORDS"     => [],                      // [OPTIONAL] forbidden words for usernames or messages

    "SALT_COOKIE"       => "",                      // [REQUIRED] randomized hash for security reasons
    "SALT_TOKEN"        => "",                      // [REQUIRED] randomized hash for security reasons
    "SALT_CACHE"        => "",                      // [REQUIRED] randomized hash for security reasons
    
    "DB_HOST"           => "",                      // [OPTIONAL] hostname to your mysql server
    "DB_USERNAME"       => "",                      // [OPTIONAL] username to your mysql server
    "DB_PASSWORD"       => "",                      // [OPTIONAL] password to your mysql server
    "DB_DATABASE"       => "",                      // [OPTIONAL] database to your mysql server

    "MAIL_HOST"         => "",                      // [OPTIONAL] hostname to your mail server
    "MAIL_SENDER"       => "",                      // [OPTIONAL] sender email address for system emails
    "MAIL_RECEIVER"     => "",                      // [OPTIONAL] receiver email address for contact form
    "MAIL_USERNAME"     => "",                      // [OPTIONAL] username to your mail server
    "MAIL_PASSWORD"     => "",                      // [OPTIONAL] password to your mail server
    #"MAIL_ENCRYPT"     => "ssl",                   // [OPTIONAL] ssl or tsl for encryption
    #"MAIL_PORT"        => "465,                    // [OPTIONAL] port to your mail server

    "DIR_ROOT"          => "/var/www"               // [REQUIRED] path to your root directory, no trailing slash
    #"DIR_CLASSES"      => "/app/classes",          // [OPTIONAL] path to your custom or extended classes
    #"DIR_ASSETS"       => "/app/assets",           // [OPTIONAL] path to your assets
    #"DIR_FONTS"        => "/app/assets/fonts",     // [OPTIONAL] path to your fonts
    #"DIR_SCRIPTS"      => "/app/assets/scripts",   // [OPTIONAL] path to your .js scripts
    #"DIR_STYLES"       => "/app/assets/styles",    // [OPTIONAL] path to your .css styles
    #"DIR_LOCALE"       => "/app/locale",           // [OPTIONAL] path to your locale .mo/.po files
    #"DIR_VENDOR"       => "/app/vendor",           // [OPTIONAL] path to your third-party libraries
    #"DIR_VIEWS"        => "/app/views",            // [OPTIONAL] path to your template files
    #"DIR_CACHE"        => "/app/cache",            // [OPTIONAL] path to your cache files
    #"DIR_MEDIA"        => "/app/media"             // [OPTIONAL] path to your media files
]);

MVC\App::init();


MVC\App::debug();

MVC\App::page([
    "slug"          => "/privacy",              // Regular Expression of your page slug
    "title"         => "Privacy Policy", 
    "description"   => "This is a custom page",
    "robots"        => "noindex, nofollow",
    "canonical"     => "/privacy",
    "class"         => "page privacy",
    "template"      => "/privacy.tpl"
]);
smarty
 {{"My text"}}