Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

config_load()

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Portuguese
View previous topic :: View next topic  
Author Message
lodjikz
Smarty Rookie


Joined: 21 Jul 2005
Posts: 9

PostPosted: Thu Jul 21, 2005 10:49 pm    Post subject: config_load() Reply with quote

ola.

estou a tentar carregar um ficheiro de configuracao para um template mas obtenho sempre este erro

PHP Warning: Smarty error: unable to read resource: "{menus.conf" in C:\Programas\PHP-5.0.4\smarty\libs\Smarty.class.php on line 1088

no template tenho algumas variaveis do smarty que sao dinamicas como por exemplo o nome das seccões. Quando vejo o codigo fonte da pagina a parte {config_load file="{$path_conf}" nao me aparece sequer... sera por estar a passar o nome do ficheiro numa variavel?!

tentei carregar o .conf do lado do php $smarty->config_load(...) mas da-me o mesmo erro...

Alguem me pode ajudar?

Obrigado.
Back to top
View user's profile Send private message
pt2002
Smarty Regular


Joined: 05 May 2003
Posts: 89
Location: Porto, Portugal

PostPosted: Sat Jul 23, 2005 3:35 pm    Post subject: Reply with quote

Viva

Tenta assim {config_load file=$path_conf}, sem as segundas chavetas e aspas.

Não deve dar problemas usar os nomes dos ficheiros de forma dinâmica.

Eu uso isso para incluir templates:

php:
assign('template', 'teste.tpl'}

tpl
{include file=$template}

Funciona sem problemas.

Cumprimentos
Back to top
View user's profile Send private message
lodjikz
Smarty Rookie


Joined: 21 Jul 2005
Posts: 9

PostPosted: Wed Jul 27, 2005 1:39 am    Post subject: Reply with quote

ola

so hj voltei o forum tuga.
entretantto tinha deixado a msg no forum geral.

Funcionou sem problemas!

Entretanto encalhei neste ponto:

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=5829

Agradeço a ajuda pt2002!

Até breve
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Portuguese All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP