zjango/phtml

simple_html_dom PHP Parser for Laravel

1.1.1 2015-04-17 15:32 UTC

This package is not auto-updated.

Last update: 2024-12-21 19:24:45 UTC


README

========

Installation

To install the package, simply add the following to your Laravel installation's composer.json file

"require": {
	"laravel/framework": "5.*",
	"zjango/phtml": "dev-master"  
},

Run the usual composer update to pull the files. Then, add the following Service Provider to your providers array in your config/app.php config.

'providers' => array(
	...
	'Zjango\Phtml\PhtmlServiceProvider',
);

And finally add a new line to the aliases array:

		'Phtml'	=>	'Zjango\Phtml\Facades\Phtml',

Usage

		$html=Phtml::init('http://www.apple.com');
		$as = $html->find('a');
		$a = $html->find('a',0);
		$a = $html->find('a',-1);
		$a = $html->find('a',0);
		$href = $a->href();
		$text = $a->text();