Download the PHP package zeecoder/good-to-know without Composer
On this page you can find all versions of the php package zeecoder/good-to-know. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zeecoder/good-to-know
More information about zeecoder/good-to-know
Files in zeecoder/good-to-know
Package good-to-know
Short Description A solution for collecting good-to-know facts to show to users.
License MIT
Informations about the package good-to-know
Good To Know v2.0
Description
The original purpose of this project was to have an easy way of collecting good-to-know facts for certain pages / features that need explanation.
To achieve that, the code was engineered in a very generic way:
- Fetch all the data with a repository call,
- Apply transformations on the returned collection and/or it's elements via Listeners.
Since the code uses listeners, it's very easy to add / remove functionality.
Built-in features
- Parameter injection
- Translation support
Integrations
- Silex2
- Symfony2
A simple example
Listeners
Without listeners, the main GoodToKnow
object doesn't do anything apart from
forwarding calls to the repository.
It gets interesting, when you throw some listeners into the mix.
The ParameterListener
This listener's job is to inject registered parameters into good-to-know strings.
The TranslationListener
This listener assumes a translator implementing Symfony's TranslatorInterface
.
Important
The TranslationListener
must be registered first, or with a higher priority
than the ParameterListener
.
That way parameters can be injected after translations occured.
Source
Consider looking at the source files, in order to enhance / alter basic functionality.
(Creating a Database Repository for example.)
- Events
- Repositories
- The Fact Object
License
MIT