Giter Site home page Giter Site logo

jhulframework / vina Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 435 KB

PHP HTML GUI Generater

PHP 92.96% JavaScript 1.89% CSS 4.99% Shell 0.06% HTML 0.10%
html ui generator html-template html-generator php-html-css-js web-gui gui-toolkit php-gui ui-builder

vina's Introduction

WEB GUI Generator

Vina is a PHP library for WEB GUI(HTML, CSS, JAVASCRIPT) Generation. It is based on css flex.

Requirement

  • PHP Version >= 5.6
  • Vina/_data directory must be writable by PHP

Including in your project

  • Clone or download this repository
  • Add the following code
require_once( '/path/to/vina/bootVina.php' );
createJApp();

Example

$view = new \Jhul\Core\Vina\View\Element('sample');

$view
->centerX()
->centerY()
->setColor('#ccc')
->setFontSize(24)
->setBackground('#242424')
->setContent('Super Cool Layout Generated Using VINA')
->growHeight();

$view->compile(); //IMPORTANT

echo $view->embed();

OUTPUT

html

Media Query

//for screen width less than 480px
$view->onMaxScreenWidth(480)->setColor('#408');

//for screen width larger than 480px
$view->onMinScreenWidth(481)->setColor( '#242424' );

Hover Effect

$view->onHover()->setColor('#999');

Border

$view->border()->setStyleSolid()->setwidth(2)->setColor('#666');

HTML Link

$view->setURL( $url ) ; //generated html will be a link

API (call after compile)

// returns compiled content Including style script and html
// browser will render it
$view->embed();

//show raw output, visible on browser
$view->show();

//to see compiled content
$view->showContent();


//returns compiled content, use view source code
$view->compiledContent();

//returns compiled style
$view->compiledStyle();

//returns compiled compiled javascript
$view->compiledScript();

STYLING API(call before compile)

$view->setColor('#111');//font color

$view->setBackground('#aaa');

$view->setFontSize(20);//20px

$view->setPadding(12);

//vertical padding
$view->setPaddingV(12);

//horizontal padding
$view->setPaddingH(12);

//fill remaining space
$view->growWidth();
$view->growHeight();

$view->setWidth(100);//100px
$view->setHeight(100);

$view->setFontFamily(12);

//center content horizontaly
$view->centerX();

//center content verticaly
$view->centerY();

//align childrens in row
$view->setOrientationVertical();
$view->enableWrap();

//align childrens in column
$view->setOrientationHorizontal();

Style Unit

$view->setWidth(100);//100px
$view->setWidth('100px');//100px

$view->setWidth('100%');//100%

$view->setWidth('100em');//100em

Note

  • If you find this project useful, please give it a star it will motivate me.
  • This libray can generate forms, templates but documentation might take time.
  • More example are available inside "example" directory
  • You dont need to use this code in you production server, copy generated output and paste it in your view template

vina's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

logic21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.