zjango / Phtml by zjango

simple_html_dom PHP Parser for Laravel
99
0
2
Package Data
Maintainer Username: zjango
Maintainer Contact: zjango@icloud.com (zjango)
Package Create Date: 2015-04-17
Package Last Update: 2015-05-23
Home Page: https://github.com/zjango/Phtml
Language: PHP
License: MIT
Last Refreshed: 2024-05-04 15:12:11
Package Statistics
Total Downloads: 99
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

PHtml

========

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();