phpQuery::newDocumentXHTML PHP Method

newDocumentXHTML() public static method

Chainable.
public static newDocumentXHTML ( unknown_type $markup = null, $charset = null ) : phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
$markup unknown_type
return phpQueryObject | QueryTemplatesSource | QueryTemplatesParse | QueryTemplatesSourceQuery
    public static function newDocumentXHTML($markup = null, $charset = null)
    {
        $contentType = $charset ? ";charset={$charset}" : '';
        return self::newDocument($markup, "application/xhtml+xml{$contentType}");
    }

Usage Example

Example #1
0
 /**
  * checks that an empty form is initialized correctly
  */
 function test_defaults()
 {
     global $INPUT;
     global $ID;
     $ID = 'some:test';
     $INPUT->get->set('id', $ID);
     $INPUT->get->set('foo', 'bar');
     $form = new Form\Form();
     $html = $form->toHTML();
     $pq = phpQuery::newDocumentXHTML($html);
     $this->assertTrue($pq->find('form')->hasClass('doku_form'));
     $this->assertEquals(wl($ID, array('foo' => 'bar'), false, '&'), $pq->find('form')->attr('action'));
     $this->assertEquals('post', $pq->find('form')->attr('method'));
     $this->assertTrue($pq->find('input[name=sectok]')->length == 1);
 }
All Usage Examples Of phpQuery::newDocumentXHTML