By D'Ali Ben Macha contact@benmacha.tn https://dali.benmacha.tn
Add the benmacha/mousetracker
package to your require
section in the composer.json
file.
$ composer require benmacha/mousetracker dev-master
Add the MouseTrackerBundle to your application's kernel:
<?php
public function registerBundles()
{
$bundles = array(
// ...
new benmacha\mousetracker\TrackerBundle(),
// ...
);
...
}
Configure the Tracker
in your routing.yml
:
mouse_tracker:
resource: "@TrackerBundle/Controller/"
type: annotation
prefix: /tracker
Configure the Tracker
in your config.yml
:
imports:
- { resource: "@TrackerBundle/Resources/config/services.yml" }
twig:
globals:
mousetrackerService: @twig_tracker
assetic:
filters:
scssphp:
formatter: 'Leafo\ScssPhp\Formatter\Compressed'
jsqueeze: ~
Create Table:
$ php app/console doctrine:schema:update --force
Dump js and css file
$ php app/console assetic:dump
Configure the TrackerService
before the end of Body tag in your *.html.twig
page:
<script>
/*
Javascript Code
*/
</script>
{{ mousetrackerService.build() }}
<script>
/*
Javascript Code
*/
</script>
</body>
</html>