SalvaJshrinkBundle
This bundle integrate "jshrink library" as Assetic filter and twig extension.
Installation
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:
$ composer require salva/jshrink-bundle
This command requires you to have Composer installed globally, as explained
in the installation chapter
of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding the following line in the app/AppKernel.php
file of your project:
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Salva\JshrinkBundle\SalvaJshrinkBundle(),
);
}
}
Configuration
Optionally, add the configuration in your config file.
# app/config.yml
salva_jshrink:
enabled: true # if false {% jshrink %} tag will not compress the content
flaggedComments: true
Basic Usage
Minifying JavaScript files
{% javascripts '@AcmeFooBundle/Resources/public/js/*' filter='jshrink' %}
<script src="{{ asset_url }}"></script>
{% endjavascripts %}
Minifying inline JavaScript
{% jshrink %}
<script>
$(document).ready(function() {
// ...
});
</script>
{% endjshrink %}
Copyright (c) 2011-2012 Yunan NSNT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
salva_jshrink:
enabled: true
flaggedComments: true
-
Removed old tests and updated dependencies
By EmanueleMinotto, 4 years ago
-
implemented Twig_Extension_GlobalsInterface
By EmanueleMinotto, 5 years ago
-
fixed phpunit version
By EmanueleMinotto, 5 years ago
-
some upgrades
By EmanueleMinotto, 5 years ago
-
Added badges
By EmanueleMinotto, 5 years ago
-
changed master alias
By EmanueleMinotto, 5 years ago
-
Merge pull request #15 from nibsirahsieu/php53
By EmanueleMinotto, 5 years ago
-
restored php 5.3 array syntax
By EmanueleMinotto, 5 years ago
-
Merge pull request #13 from EmanueleMinotto/master
By EmanueleMinotto, 5 years ago
-
Merge pull request #1 from EmanueleMinotto/analysis-zde1J8
By EmanueleMinotto, 5 years ago
-
Applied fixes from StyleCI
By StyleCIBot, 5 years ago
-
Merge pull request #12 from EmanueleMinotto/master
By EmanueleMinotto, 5 years ago
-
fixed and expanded travis-ci.org configuration
By EmanueleMinotto, 5 years ago
-
Added travis-ci.org configuration
By EmanueleMinotto, 5 years ago
-
fixed symfony 2.7 runtime error
By EmanueleMinotto, 5 years ago
-
Merge pull request #8 from lingoda/feature/cache-minified-content
By EmanueleMinotto, 5 years ago
-
Fixed tests
By artursvonda, 5 years ago
-
Cache minified content for performance
By artursvonda, 5 years ago
-
restored branch-alias
By EmanueleMinotto, 6 years ago
-
removed branch-alias for simpler maintainance
By EmanueleMinotto, 6 years ago
-
canonical composer.json
By EmanueleMinotto, 6 years ago
-
updated documentation with #7
By EmanueleMinotto, 6 years ago
-
Merge branch 'pr/7'
By EmanueleMinotto, 6 years ago
-
Symfony 2 bundles best practices
By EmanueleMinotto, 6 years ago
-
Development support
By EmanueleMinotto, 6 years ago
-
Added OEF newline
By EmanueleMinotto, 6 years ago
-
added myself as a collaborator
By EmanueleMinotto, 6 years ago
-
Merge pull request #5 from EmanueleMinotto/master
By EmanueleMinotto, 6 years ago
-
Allow disabling Twig extension from config
By artursvonda, 6 years ago
-
Lowest requirements
By EmanueleMinotto, 6 years ago