11.. index ::
22 single: Assetic; Apply filters
33
4- How to Apply an Assetic Filter to a Specific File Extension
4+ Kako uporabiti Assetic Filter na določeni končnici datoteke
55===========================================================
66
7- Assetic filters can be applied to individual files, groups of files or even ,
8- as you'll see here, files that have a specific extension. To show you how
9- to handle each option, let's suppose that you want to use Assetic's CoffeeScript
10- filter, which compiles CoffeeScript files into JavaScript.
7+ Filtri Assetic-a se lahko uporabijo na posameznih datotekah, skupinah datotek ali celo ,
8+ kot boste videli tu, datotekah, ki imajo specifično končnico. Za prikaz,
9+ kako se upravlja z vsako opcijo, predpostavimo, da želite uporabiti Assetic-ov CoffeeScript
10+ filter, ki prevede CoffeeScript datoteke v JavaScript.
1111
12- The main configuration is just the paths to coffee, node and node_modules.
13- An example configuration might look like this :
12+ Glavna nastavitev so samo poti do coffee, node in node_modules.
13+ Primer nastavitve lahko izgleda takole :
1414
1515.. configuration-block ::
1616
@@ -28,7 +28,7 @@ An example configuration might look like this:
2828
2929 <!-- app/config/config.xml -->
3030 <assetic : config >
31- <assetic : filter
31+ <assetic : filter
3232 name =" coffee"
3333 bin =" /usr/bin/coffee/"
3434 node =" /usr/bin/node/" >
@@ -49,11 +49,11 @@ An example configuration might look like this:
4949 ),
5050 ));
5151
52- Filter a Single File
53- --------------------
52+ Filter nad posamezno datoteko
53+ -----------------------------
5454
55- You can now serve up a single CoffeeScript file as JavaScript from within your
56- templates :
55+ Sedaj lahko pošljete eno CoffeeScript datoteko kot JavaScript iz vaših
56+ predlog :
5757
5858.. configuration-block ::
5959
@@ -72,13 +72,13 @@ templates:
7272 <script src="<?php echo $view->escape($url) ?>" type="text/javascript"></script>
7373 <?php endforeach; ?>
7474
75- This is all that's needed to compile this CoffeeScript file and server it
76- as the compiled JavaScript.
75+ To je vse, kar je potrebno za prevod te CoffeeScript datoteke in jo ponuditi kot
76+ preveden JavaScript.
7777
78- Filter Multiple Files
79- ---------------------
78+ Filtriranje večih datotek
79+ -------------------------
8080
81- You can also combine multiple CoffeeScript files into a single output file :
81+ Lahko tudi združite več CoffeeScript datotek v eno izhodno datoteko :
8282
8383.. configuration-block ::
8484
@@ -102,25 +102,24 @@ You can also combine multiple CoffeeScript files into a single output file:
102102 <script src="<?php echo $view->escape($url) ?>" type="text/javascript"></script>
103103 <?php endforeach; ?>
104104
105- Both the files will now be served up as a single file compiled into regular
106- JavaScript.
105+ Obe datoteki bosta ponujeni kot ena prevedena datoteka v običajnem
106+ JavaScript-u .
107107
108108.. _cookbook-assetic-apply-to :
109109
110- Filtering based on a File Extension
111- -----------------------------------
110+ Filtriranje na osnovi končnice datoteke
111+ ---------------------------------------
112112
113- One of the great advantages of using Assetic is reducing the number of asset
114- files to lower HTTP requests. In order to make full use of this, it would
115- be good to combine *all * your JavaScript and CoffeeScript files together
116- since they will ultimately all be served as JavaScript. Unfortunately just
117- adding the JavaScript files to the files to be combined as above will not
118- work as the regular JavaScript files will not survive the CoffeeScript compilation.
113+ Ena izmed odličnih prednosti uporabe Assetic-a je zmanjšanje števila datotek
114+ sredstev na manjše HTTP zahtevke. Za polno uporabo tega bi bilo
115+ dobro združiti *vse * vaše JavaScript in CoffeeScript datoteke skupaj,
116+ saj bodo na koncu poslane kot JavaScript. Na žalost samo
117+ dodajanje JavaScript datotek ne bo prestalo CoffeeScript prevajanja.
119118
120- This problem can be avoided by using the ``apply_to `` option in the config ,
121- which allows you to specify that a filter should always be applied to particular
122- file extensions. In this case you can specify that the Coffee filter is
123- applied to all ``.coffee `` files :
119+ Temu problemu se lahko izognemo z uporabo ``apply_to `` opcije v nastavitvah ,
120+ kar vam omogoča, da določite, da filter bi moral biti vedno uporabljen na določenih
121+ vrstah datotek. V tem primeru lahko določite, da je Coffee filter uporabljen
122+ na vseh ``.coffee `` datotekah :
124123
125124.. configuration-block ::
126125
@@ -161,10 +160,10 @@ applied to all ``.coffee`` files:
161160 ),
162161 ));
163162
164- With this, you no longer need to specify the ``coffee `` filter in the template .
165- You can also list regular JavaScript files, all of which will be combined
166- and rendered as a single JavaScript file (with only the ``.coffee `` files
167- being run through the CoffeeScript filter):
163+ S tem ne potrebujete več določati ``coffee `` filtra v predlogi .
164+ Lahko tudi dodate običajne JavaScript datoteke, vse tiste, ki bodo prevedene
165+ in izpisano kot ena JavaScript datoteka (s tem, da bodo samo ``.coffee `` datoteke
166+ pognane skozi CoffeeScript filter):
168167
169168.. configuration-block ::
170169
0 commit comments