zjango / phtml
simple_html_dom PHP Parser for Laravel
1.1.1
2015-04-17 15:32 UTC
Requires
- ext-dom: *
- zjango/laracurl: >=1.1.1
This package is not auto-updated.
Last update: 2024-11-23 18:54:54 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();