PHP Manual
PEAR Manual
Smarty Manual
PostgreSQL
MySQL Manual
Perl Manual
Ciekawe adresy
- Transport krajowy
- Makijaż Permanentny Warszawa
- Muzyka cygańska
- Tłumaczenia
- Nawigacja
- Odzież Ochronna I Robocza
- Wypożyczalnia Samochodów Łódź
Czytnik RSS
» "Supertelewizor" Cell TV Toshiby nie dla EuropyZbyt wysoka cena i zbędne możliwości, okazały się przyczyną, dla której Toshiba zrezygnowała z wprowadzenia do Europy swojego Cell TV. Zamiast niego, jakby na pocieszenie,otrzymamy słabszą wersję telewizora.
» Microsoft: Silverlight jest lepszy od HTML 5
Silverlight ciągle jest oczkiem w głowie Microsoftu. Firma nie boi się wdrożenia technologii HTML 5. Twórcy Silverlight twierdzą, że ich produkt jest po prostu lepszy.
» Poniedziałkowy Przegląd Prasy
TP idzie na wojnę... Ten rok ma być dla Comarchu lepszy... Definitywne porozumienie w sprawie fuzji HP i 3PAR... Hyperion z MNI Telecom na zakupach... Asseco Poland przejmuje firmę IT notowaną na NASDAQ... Firmy chętnie reklamują się na Facebooku czy Naszej-klasie... Fujitsu zwiększa aktywność w Polsce... Nowe komórki nie są bezpieczne... Coraz bliżej startu cyfrowej telewizji naziemnej... City Interactive jest już graczem globalnym...
» Uniwersytet Missouri: małe baterie atomowe
Baterie nuklearne, wytwarzające energię z rozkładu radioizotopów są atrakcyjną propozycją do wielu zastosowań, ponieważ izotopy, które je zasilają mogą dostarczać użytecznej ilości prądu przez setki lat przy gęstościach elektrycznych milion razy wyższych niż w standardowych bateriach. Baterie atomowe służyły wojsku i służbom powietrznym przez wiele lat, jednak ich duża wielkość ograniczała powszechne użytkowanie.
block functions
block functions are functions of the form: {func} .. {/func}. in other words, they enclose a template block and operate on the contents of this block. block functions take precedence over custom functions of the same name, that is, you cannot have both custom function {func} and block function {func} .. {/func}.
by default your function implementation is called twice by smarty: once for the opening tag, and once for the closing tag (see &$repeat below how to change this).
only the opening tag of the block function may have attributes. all attributes passed to template functions from the template are contained in the $params as an associative array. you can access those values as e.g. $params['start']. the opening tag attributes are also accessible to your function when processing the closing tag.
the value of $content variable depends on whether your function is called for the opening or closing tag. in case of the opening tag, it will be null, and in case of the closing tag it will be the contents of the template block. note that the template block will have already been processed by smarty, so all you will receive is the template output, not the template source.
the parameter &$repeat is passed by reference to the function implementation and provides a possibility for it to control how many times the block is displayed. by default $repeat is true at the first call of the block-function (the block opening tag) and false on all subsequent calls to the block function (the block's closing tag). each time the function implementation returns with &$repeat being true, the contents between {func} .. {/func} are evaluated and the function implementation is called again with the new block contents in the parameter $content.
if you have nested block functions, it's possible to find out what the parent block function is by accessing $smarty->_tag_stack variable. just do a var_dump() on it and the structure should be apparent.
see also: register_block(), unregister_block().
Najskuteczniejsza reklama to pozycjonowanie - Pozycjonowanie stron <= zajrzyj tu i dowiedz się więcej o pozycjonowanie stron