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 — Registra dinamicamente un plugin de recurso

Descripción

void register_resource(string name,
                       array resource_funcs);

Use esto para registrar dinámicamente un recurso de plugin con Smarty. Pase el nombre o el recurso y o el arreglo de funciones que implementa esto. Vea template resources para mayor información de como configurar una función para mandar llamar templates.

Nota técnica

El nombre del recurso debe tener al menos dos caracteres de largo. Un nombre de recurso de un carácter será ignorado y usado como parte del path del archivo como, $smarty->display('c:/path/to/index.tpl');

La php-funcion-array resource_funcs debe tener 4 o 5 elementos. Con 4 elementos los elementos son las llamadas para las respectivas funciones de recurso "source", "timestamp", "secure" y "trusted". Con 5 elementos el primer elemento tiene que ser un objeto por referencia o un nombre de clase del objeto o una clase implementando el recurso y los 4 elementos siguientes tiene que ser los nombres de los métodos implementando "source", "timestamp", "secure" y "trusted".

Example 13.25. register_resource


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

   

Ver también unregister_resource() y template resources

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 5 plus 20? (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