PHP code example of anvii / htmlelement

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

    

anvii / htmlelement example snippets

 php
$form = $html->first('form#login');
$form->query('input[type="submit"]')->addClass('nice-button');
 php
echo HtmlElement::a(['href'=>'/user/profile', '_if'=>isUserRegistered()], 'Profile');
 php
$userMenu->add([
    HtmlElement::a(['href'=>'/user/profile', '_weight'=>10], 'Profile'),
    HtmlElement::a(['href'=>'/user/password', '_weight'=>12], 'Change Password'),
    HtmlElement::a(['href'=>'/user/Logout', '_weight'=>100], 'Logout'),
]);

// From module:
HtmlElement::first('#userMenu')->add(
    HtmlElement::a(['href'=>'gallery', 'weight'=>30])
);