PHP code example of kyleclarkenz / manhattan

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

    

kyleclarkenz / manhattan example snippets


use Manhattan\HtmlHelper;

HtmlHelper::configure(
    '/Manhattan/assets/css',   // web-root-relative path to Manhattan CSS
    '/Manhattan/assets/js'     // web-root-relative path to Manhattan JS
);

HtmlHelper::configure(
    '/Manhattan/assets/css',
    '/Manhattan/assets/js',
    '/custom/fontawesome'      // optional: override Font Awesome public path
);

// In <head> — renders Manhattan CSS + Font Awesome automatically:
<?= $m->renderStyles() 

use Manhattan\HtmlHelper;

$m = HtmlHelper::getInstance();

// Render a button
echo $m->button('saveBtn', 'Save')->primary()->icon('fa-save');

// Render a dropdown
echo $m->dropdown('priority')
    ->dataSource([
        ['value' => '1', 'text' => 'Low'],
        ['value' => '2', 'text' => 'High'],
    ])
    ->placeholder('Select priority…');

// Render a date picker
echo $m->datepicker('dueDate')->value(date('Y-m-d'))->min(date('Y-m-d'));

echo $m->button('deleteBtn', 'Delete')->danger()->icon('fa-trash');