https://github.com/programarivm/hello-world-bundle
Hello world is a simple, ready-to-clone Symfony 5 bundle to be extended as you'd want.
https://github.com/programarivm/hello-world-bundle
Last synced: 11 months ago
JSON representation
Hello world is a simple, ready-to-clone Symfony 5 bundle to be extended as you'd want.
- Host: GitHub
- URL: https://github.com/programarivm/hello-world-bundle
- Owner: programarivm
- Created: 2020-02-29T13:32:57.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-29T19:31:35.000Z (almost 6 years ago)
- Last Synced: 2025-01-08T14:16:15.088Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hello World Bundle
Hello world is a simple, ready-to-clone Symfony 5 bundle to be extended as you'd want.
Install the package with:
```console
composer require programarivm/hello-world-bundle
```
Make sure the `Programarivm\HelloWorldBundle\HelloWorldBundle` is enabled in your `config/bundles.php` file.
And... that's it!
> This bundle is a simplified flavour of [`knpuniversity/lorem-ipsum-bundle`](https://github.com/programarivm/lorem-ipsum-bundle)
## Usage
`programarivm/hello-world-bundle` provides a single service to receive a radio signal from a planet far away in the galaxy, which you can autowire by using the `HelloWorld` type-hint:
```php
// src/Controller/SomeController.php
use Programarivm\HelloWorldBundle\HelloWorld;
// ...
class SomeController
{
public function index(HelloWorld $helloWorld)
{
$signal = $helloWorld->signal();
// ...
}
}
```
This service can also be accessed directly using the id `programarivm.hello_world`.
## Configuration
The radio signal can be configured directly by creating a new `config/packages/programarivm_hello_world.yaml` file:
```yaml
programarivm_hello_world:
name: '51 Pegasi c'
is_exoplanet: true
satellites: 10
```
Finally, a greeting command can optionally be added to your `config/services.yaml` file:
```yaml
Programarivm\HelloWorldBundle\Command\GreetCommand:
tags: ['console.command']
```
To run the command:
php bin/console hello-world:greet
Here is the signal received from 51 Pegasi c:
Greeting command
================
Hello world! Name: 51 Pegasi c. Exoplanet: true. Satellites: 10.
### Testing
`programarivm/hello-world-bundle` is developed and tested with the help of [Zebra](https://github.com/programarivm/zebra) which is a Symfony 5 app behaving as a host in order to develop and test Symfony 5 bundles.
### Contributions
Would you help make this library better? Contributions are welcome.
- Feel free to send a pull request
- Drop an email at info@programarivm.com with the subject "Hello World Bundle"
- Leave me a comment on [Twitter](https://twitter.com/programarivm)
Many thanks.