PHP code example of elemento115 / bugtracker-bundle
1. Go to this page and download the library: Download elemento115/bugtracker-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
elemento115 / bugtracker-bundle example snippets
// ../app/AppKernel.php
use \Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Elemento115\BugtrackerBundle\BugtrackerBundle(),
);
// ...
return $bundles;
}
// ...
}
namespace AppBundle\Controller;
use Elemento115\BugtrackerBundle\Services\ApiClient;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
/**
* Class ExampleController
* @package AppBundle\Controller
*/
class ExampleController extends Controller
{
/**
* @Route("/example")
*/
public function logAction()
{
/** @var ApiClient $bugTracker */
$bugTracker = $this->get('bugtracker.client.test');
// bugtracker.client.test maps to registries.test of your config.yml
$bugTracker->post([
'log' => [
'message' => 'This is a message',
'level' => 'debug'
]
]);
}
}