Get Smarty

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

Name

register_resource

void register_resource(string name,
                       array resource_funcs);

Usatelo per registrare dinamicamente un plugin risorsa per Smarty. Passate il nome della risorsa e l'array delle funzioni PHP che la implementano. Consultate risorse per i template per maggiori informazioni su come impostare una funzione per caricare i template.

Nota tecnica

Il nome di una risorsa deve avere un minimo di due caratteri di lunghezza. Nomi di risorsa di un solo carattere verranno ignorati ed usati come parte del percorso del file; ad es. $smarty->display('c:/path/to/index.tpl');

L'array di funzioni php resource_funcs deve avere 4 o 5 elementi. Con 4 elementi, questi saranno le funzioni callback per le rispettive funzioni "source", "timestamp", "secure" e "trusted" della risorsa. Con 5 elementi, il primo deve essere il riferimento all'oggetto oppure il nome della classe relativi all'oggetto o alla classe che implementano la risorsa, mentre i 4 elementi successivi saranno i nomi dei metodi che implementano "source", "timestamp", "secure" e "trusted".

Example 13.24. register_resource


<?php
$smarty->register_resource("db", array("db_get_template",
"db_get_timestamp",
"db_get_secure",
"db_get_trusted"));
?>

   

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 0 plus 18? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk