1. Go to this page and download the library: Download eftec/dashone 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/ */
eftec / dashone example snippets
use eftec\DashOne\DashOne;
$dash=new DashOne();
$dash->head('Example - test 1'); // it is renders an empty page
use eftec\DashOne\DashOne;
$dash=new DashOne();
$dash->head('Example - test 1');
$dash->footer();
$dash->render();
use eftec\DashOne\DashOne;
$dash=new DashOne();
$dash->head('Example - test 1')
->footer()
->render();
// see examples/testuibasic.php
$dash=new DashOne();
$dash->head('Example - test 1')
->menuUpper(['Upper title'])
->startcontent()
->menu($links) // left menu
->startmain()
// here it goes the content
->endmain()
->endcontent()
->footer()
->render();
$dash->alert("It is an alert","Content of the alert")
$dash->alert("It is an alert","Content of the alert","alert alert-danger")
$buttons=[
new ButtonOne('button1','Click me','btn btn-primary'),
new ButtonOne('button2','Click me too','btn btn-danger')
];
$dash->buttons($buttons,false) // where if true then buttons are aligned with the form
$currentValue=['IdProduct'=>"2"
,'Name'=>"aaa"
,'Price'=>"333"
,'Type'=>1
,'Description'=>''];
$dash->form($currentValue) // it's macro of new FormOne()
$definition=['IdProduct'=>'hidden'
,'Name'=>'text'
,'Price'=>'text'
,'Type'=>['cocacola','fanta','sprite']
,'Description'=>'textarea'];
$currentValue=['IdProduct'=>"2"
,'Name'=>"aaa"
,'Price'=>"333"
,'Type'=>1
,'Description'=>''];
$dash->form($currentValue,$definition) // it's macro of new FormOne()
$valueUL=['Cocacola','Fanta','Sprite'];
$dash->ul($valueUL) // it's macro of new UlOne()
$values=
[
['IdProduct'=>1,'Name'=>'Cocacola','Price'=>"20.2"],
['IdProduct'=>2,'Name'=>'Fanta','Price'=>"30.5"],
['IdProduct'=>3,'Name'=>'Sprite','Price'=>"11.5"],
];
$dash->table($values)->... // it must be called after the render
$dash=new DashOne();
$dash->head('Example - test 1');
$dash->footer();
$dash->render();
$dash=new DashOne();
$dash->head('Example - test 1');
$dash->menuUpper([new ImageOne('https://via.placeholder.com/32x32')," - ",new LinkOne('Cocacola','#')]);
$dash
->startcontent() // start the container
->menu($links) // left menu
->startmain() // start the main container
->title('Table of Products')
->endmain()
->endcontent();
$dash->footer();
$dash->render();
$dash->head('Example - test 1','',true) // title of the page, extra content in the header and true= for login page
->login($user,null,'Sign-In') // user variable, null or link to the login image and title of the login page
->alert($message) // (optional) shows an alert inside the login page
->footer() // (optional) shows a footer inside the login
->endLogin() // end login container
->render();
session_destroy();
unset($_SESSION['user']);
if (!$dash->checkCSRF()) {
die(1);
}
if (isset($_SESSION['user']) ) {
// user has sign-in
} else {
// user hasn't sign-in
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.