Table of Contents
This is a library that does just that; generates HTML markdown using fluent PHP classes. This library can be used anywhere where you can have PHP and HTML coexist. Worth noting, this library was made just for fun.
- HTML Elements
DivsParagraphsImagesLinksInputs (text, mail, phone, passwoord, date, file, select...)Tables (row, columns, header...)FormsHeadingsLists (ordered and unordered)Line break
- CSS Framework
Bootstrap 5
To set up a local instance of the application, follow the steps below.
The following dependencies are required to be installed for the project to function properly:
- PHP 8+
- Composer
Now that the environment has been set up and configured to properly compile and run the project, the next step is to install and configure the project locally on your system.
- Install the library
composer require xana/gen-html- Have fun!
Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space.
use Xana\GenHtml\Elements\Button;
use Xana\GenHtml\Elements\Email;
use Xana\GenHtml\Elements\Form;
use Xana\GenHtml\Elements\Password;
use Xana\GenHtml\Elements\TextArea;
require 'vendor/autoload.php';
$paragraphWithInlineLink = new Paragraph('A paragraph, but you can click {here} to visit example.com');
$paragraphWithInlineLink->addInlineElement('here', new link('//example.com', 'here'));
$paragraphWithInlineLink->render();
$defaultAttrs = [
"required" => true,
'placeholder' => 'Enter your message here',
];
$form = $form->addElement(new Email("email", ["placeholder" => "Email Address", 'class'=>'bg-info'])->keepDefaultClasses())
->addElement(new Password("password", ["placeholder" => "Password"]))
->addElement(new TextArea('the-text', $defaultAttrs))
->addElement(new Button("Login"));
echo $form->render();📫 Omar SAKHRAOUI ( aka Xana )