Giter Site home page Giter Site logo

webfiori / ui Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 904 KB

A set of classes for creating HTML documents.

Home Page: https://webfiori.com/learn/ui-package

License: MIT License

PHP 94.03% HTML 5.97% Vue 0.01%
html php dom data-structures linked-list slot html-document webfiori-ui html-element webfiori-framework

ui's People

Contributors

ibrahimbeladi avatar usernane avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ui's Issues

[Bug] Does not Escape Double Quotes in Attribute Value

When using the method HTMLNode::setAttribute() with an attribute which has a string as a value and the string contains double Quotes, the generated HTML will be invalid.

Example

$node = new HTMLNode('input')
$node->setAttribute('placeholder','This will "CAUSE" the bug to appear');
echo $node;

The output of the shown code will be as follows:

<input placeholder="This will "CAUSE" the bug to appear">

The double quotes will cause the value of the attribute to be "This will " and the remaining text will invalidate the generated HTML.

[Bug] Performanc is Degraded When building Big HTML Trees

It was noticed that if HTML elements tree goes very deep, the performance of rendering the page becomes worst. The reason for this is caused by the method HTMLNode::_setParent(). The method loops through all child notes to set if attribute names are quoted or not.

RTL in html

Add direction attribute with value rtl in case of arabic language to html tag, so that <html lang="ar"> will become <html dir="rtl" lang="ar"> instead.

[Enhancement] Easily access last node in TableRow class

Description

Make a pointer to the last node in the TableRow class in order to facilitate the setting of attributes and classes.

Current Implementations

You need to know the index of node, which might be troublesome when adding/removing other nodes.

$tableRow->addCell('something');
$tableRow->children()->get(5)->setStyle(['color' => 'red']);

Also, this implementation, which will require more boilerplate code.

$tableRow->addCell('something');
$tableRow->children()->get($tableRow->childrenCount() - 1)->setStyle(['color' => 'red']);

Desired Implementation

$tableRow->addCell('something');
$tableRow->getLastChild()->setStyle(['color' => 'red']);

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.