summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authortopot <[email protected]>2018-03-09 18:52:57 +0300
committertopot <[email protected]>2018-03-09 18:52:57 +0300
commite2ceb450e96b1a66af597ae0a09792815ecbd28f (patch)
treed5a50ebf70924855a4b48cfaaeb65ffa44713007 /README.md
parenta2db9880e856bcc6c2f49438c55d62749ed68a3b (diff)
Added: Configuration parameters array constructor injection
Diffstat (limited to 'README.md')
-rw-r--r--README.md16
1 files changed, 13 insertions, 3 deletions
diff --git a/README.md b/README.md
index 5b19de6..34441b9 100644
--- a/README.md
+++ b/README.md
@@ -68,11 +68,21 @@ You can change the behaviour of Readability via the Configuration object. For ex
```php
$configuration = new Configuration();
-$configuration->setFixRelativeURLs(true)
+$configuration
+ ->setFixRelativeURLs(true)
->setOriginalURL('http://my.newspaper.url/article/something-interesting-to-read.html');
```
+Also you can pass an array of configuration parameters to the constructor:
+```php
+$configuration = new Configuration([
+ 'fixRelativeURLs' => true,
+ 'originalURL' => 'http://my.newspaper.url/article/something-interesting-to-read.html',
+ // other parameters ... listing below
+]);
+```
+
-Then you pass this Configuration object to Readability. The following options are available. Remember to prepend `set` when calling them.
+Then you pass this Configuration object to Readability. The following options are available. Remember to prepend `set` when calling them using native setters.
- **MaxTopCandidates**: default value `5`, max amount of top level candidates.
- **WordThreshold**: default value `500`, minimum amount of characters to consider that the article was parsed successful.
@@ -173,4 +183,4 @@ Based on Arc90's readability.js (1.7.1) script available at: http://code.google.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License. \ No newline at end of file
+ limitations under the License.