PHP Manual
PEAR Manual
Smarty Manual
PostgreSQL
MySQL Manual
Perl Manual
Ciekawe adresy
- Rolety rzymskie
- Striptiz Męski
- Makijaż Permanentny Warszawa
- Cyganie
- Agencja Reklamowa
- Opony
- Szkolenia
- Manekiny
Czytnik RSS
» Czwartkowy Przegląd PrasyTP interesuje się kupnem Aster... Google tworzy projekt konkurencyjny dla Facebooka... Zysk TPSA powyżej konsensusu... IBM otwiera centrum cloud computing na Politechnice Wrocławskiej... Jedna trzecia MŚP nie korzysta z usług IT... Polskie firmy chcą być częścią nadchodzącej rewolucji w rozrywce... Motorola kpi z najnowszego iPhona... Nawet Disney jest zainteresowany grami społecznościowymi...
» Mount & Blade: Warband - najnowsze demo do pobrania
Programiści z TaleWorlds przygotowali dla wszystkich fanów RPG nową odsłonę samodzielnego dodatku do gry Mount & Blade - Warband. Wersja oznaczona numerem 1.127 jest już dostępna do pobrania w dziale IDG Download.
» Google prezentuje Aplikacje dla administracji publicznej
Koncern Google zaprezentował oficjalnie nową wersję pakietu Aplikacje Google - przeznaczoną dla użytkowników z instytucji rządowych oraz administracji publicznej. Zestaw Google Apps for Government na razie dostępny jest jedynie w USA - niewykluczone jednak, że z czasem koncern wprowadzi go również na inne rynki.
» TDK: Optyczne dyski 320GB
TDK ogłosiło opracowanie prototypu optycznego dysku mieszczącego 320GB informacji, czyli 6 razy więcej od obecnie dostępnych nośników o najwyższej pojemności. Dwunastocentymetrowy dysk ma 10 warstw zapisu, każda z nich ma przechowywać 32GB. Dyski Blu-ray potrafią zapisać do 25GB na każdą warstwę, a największymi nośnikami dostępnymi na rynku są ich wersje dwuwarstwowe.
{insert}
{insert} tags work much like {include} tags, except that {insert} tags are not cached when you have template caching enabled. they will be executed on every invocation of the template.
| attribute name | type | required | default | description |
|---|---|---|---|---|
| name | string | yes | n/a | the name of the insert function (insert_name) |
| assign | string | no | n/a | the name of the template variable the output will be assigned to |
| script | string | no | n/a | the name of the php script that is included before the insert function is called |
| [var ...] | [var type] | no | n/a | variable to pass to insert function |
let's say you have a template with a banner slot at the top of the page. the banner can contain any mixture of html, images, flash, etc. so we can't just use a static link here, and we don't want this contents cached with the page. in comes the {insert} tag: the template knows #banner_location_id# and #site_id# values (gathered from a config file), and needs to call a function to get the banner contents.
in this example, we are using the name "getbanner" and passing the parameters #banner_location_id# and #site_id#. smarty will look for a function named insert_getbanner() in your php application, passing the values of #banner_location_id# and #site_id# as the first argument in an associative array. all {insert} function names in your application must be prepended with "insert_" to remedy possible function name-space conflicts. your insert_getbanner() function should do something with the passed values and return the results. these results are then displayed in the template in place of the {insert} tag. in this example, smarty would call this function: insert_getbanner(array("lid" => "12345","sid" => "67890")); and display the returned results in place of the {insert} tag.
if you supply the "assign" attribute, the output of the {insert} tag will be assigned to this template variable instead of being output to the template. note: assigning the output to a template variable isn't too useful with caching enabled.
if you supply the "script" attribute, this php script will be included (only once) before the {insert} function is executed. this is the case where the insert function may not exist yet, and a php script must be included first to make it work. the path can be either absolute, or relative to $trusted_dir. when security is enabled, the script must reside in $trusted_dir.
the smarty object is passed as the second argument. this way you can reference and modify information in the smarty object from within the {insert} function.
technical note: it is possible to have portions of the template not cached. if you have caching turned on, {insert} tags will not be cached. they will run dynamically every time the page is created, even within cached pages. this works good for things like banners, polls, live weather, search results, user feedback areas, etc.
Najskuteczniejsza reklama to pozycjonowanie - Pozycjonowanie stron <= zajrzyj tu i dowiedz się więcej o pozycjonowanie stron