Download the PHP package tekord/robots-txt-provider without Composer
On this page you can find all versions of the php package tekord/robots-txt-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tekord/robots-txt-provider
More information about tekord/robots-txt-provider
Files in tekord/robots-txt-provider
Package robots-txt-provider
Short Description Provides various framework-agnostic ways to generate the contents of the robots.txt file
License MIT
Homepage https://github.com/tekord/robots-txt-provider
Informations about the package robots-txt-provider
Framework-agnostic ROBOTS.TXT File Content Generator Kit
This package provides various framework-agnostic ways to generate the contents of the robots.txt file.
Installation
Install the package via Composer:
Usage
Here are the available content providers:
- StringContentProvider - returns a plain string
- FileContentProvider - returns the contents of the specified file
- CallbackContentProvider - used a callback to get the value
- CompositeContentProvider - used to compose multiple providers, returns the value of the first provider that returns a non-NULL value
ContentBuilder
The ContentBuilder class provides handy methods for generating content:
Will return the following:
The following methods have a conditional version: line
, emptyLine
, comment
, parameter
, allow
and disallow
.
Just add If
to the end of the method name like lineIf
. The first parameter is a condition (boolean or callback). If
the condition is TRUE then the method executes. For instance:
Will return the following:
StringContentProvider
FileContentProvider
CallbackContentProvider
CompositeContentProvider
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.