dev-master
9999999-dev http://github.com/llvdl/TweeterCoreBundleExample Symfony2 bundle
MIT
The Requires
The Development Requires
bundle example
Wallogit.com
2017 © Pedro Peláez
Example Symfony2 bundle
This is a sample Symfony2 bundle that contains a simple service to store and retrieve "tweets". The bundle consists of a service implementation, including a repository based on doctrine. It has no forms or controllers., (*1)
Add the following line to the require section in your composer.json file:, (*2)
"llvdl/example-tweeter-core-bundle": "dev-master", (*3)
and run composer update., (*4)
Add the following item to the $bundles array in registerBundles in
AppKernel.php:, (*5)
new Llvdl\TweeterCoreBundle\TweeterCoreBundle(), (*6)
You should have the doctrine/orm package installed. Also a
database and user must be created. The configuration of the database properties
is probably at app/config/parameters.yml., (*7)
To create the database tables, run:, (*8)
php app/console doctrine:schema:create, (*9)
To see the SQL queries to create the tables, but not execute them, add the
--dump-sql flag:, (*10)
php app/console doctrine:schema:create --dump-sql, (*11)
The bundle gives access to the tweet_service service, which has the following
methods (see TweetService.php for details):, (*12)
Tweets are short messages created by a tweeter. When creating a tweet, the tweeter entity is created automatically if it does not already exist., (*13)
To get a list of recent tweets in a controller:, (*14)
$service = $this->get('llvdl_tweeter_core.tweet_service');
$tweets = $service->getRecentTweets();
// do something with $tweets
Example Symfony2 bundle
MIT
bundle example