PHP code example of webforge / dom

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

    

webforge / dom example snippets


$hiddenInput = Query::create('form.main', $this->html)->find('input[name="submitted"]');

// returns an instanceof Query with the html: <input type="hidden" name="submitted" value="true" />

$fieldsetUserData = Query::create('form.main', $this->html)->find('fieldset')->eq(0);

$url = Query::create('a', '<a href="http://www.ps-webforge.com" class="def"></a>')->attr('href');
// 'http://www.ps-webforge.com'

$innerHtml = Query::create('fieldset:first', $this->html)->html();

// '<input type="text" name="email" value="" /><br /><br /><input type="text" name="name" value="" /><br />'

$html = Query::create('fieldset:first [name="email"]', $this->html)->outerHtml();

// '<input type="text" name="email" value="" />'

$true = Query::create('fieldset:first', $this->html)->hasClass('user-data');

$true = Query::create('fieldset:first', $this->html)->hasClass('group');

$false = Query::create('fieldset:first', $this->html)->hasClass('user-data.group');