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

Smarty und Ordner?

 
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: German
View previous topic :: View next topic  
Author Message
adrianryser
Smarty n00b


Joined: 09 Sep 2004
Posts: 3
Location: Schweiz

PostPosted: Thu Sep 09, 2004 7:17 pm    Post subject: Smarty und Ordner? Reply with quote

Hallo zusammen

habe eine frage. kann ich weiterhin meine php-files in ordner legen? kann ich im templates-order auch unterordner erstellen? das würde die übersichtlichkeit der quelldateien meines webprojekt erhöhen.

danke für eure hilfe.

grüess adrian Very Happy
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Sep 09, 2004 10:08 pm    Post subject: Reply with quote

beides: ja.

deine php-file-struktur beinflusst smarty nicht.
das php kontrolliert smarty, nicht umgekehrt.

unterorder von "templates" sind auch kein problem, man muss nur bedenken, dass {include} nicht relative zum aktuellen template sondern relative zu $smarty->template_dir included.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
adrianryser
Smarty n00b


Joined: 09 Sep 2004
Posts: 3
Location: Schweiz

PostPosted: Fri Sep 10, 2004 6:41 am    Post subject: hab ich das richtig verstaden? Reply with quote

Hallo

vielen Dank für deine schnelle Antwort. Jedoch habe ich, so glaube ich, etwas nicht richtig verstanden...
Weshalb findet Smarty das angegebene Template nicht? Habe gelesen, dass ich alle Pfade absolut angeben muss. Dieses PHP liegt im Unterordner Admin, und das Template ebenfalls im Ordner Admin, einfach als Unterordner der Templates. Wieso bringt Smarty folgenden Error?

Warning: Smarty error: unable to read resource: "admin/index.tpl" in /home/cust/netdotch/public_html/sisprocom_ch/tools/netgallery/smarty/libs/Smarty.class.php on line 1083

Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory. in /home/cust/netdotch/public_html/sisprocom_ch/tools/netgallery/smarty/libs/Smarty.class.php on line 1083



Hier meine PHP-Datei:

[php:1:2de15adf0c]<?php
$path = "/home/cust/netdotch/public_html/sisprocom_ch/tools/netgallery";

//Require
require("$path/inc/classes.inc.php");
require("$path/inc/settings.inc.php");
require("$path/inc/functions.inc.php");

//Instances
$smarty = new Smarty;

//Smarty-Special
$smarty->compile_check = true;
$smarty->debugging = true;

//Event
$event = getEvents($tab_events,'id','DESC');
$smarty->assign('event',$event);

//Album
$album = getAlbums($tab_albums,'id','DESC');
$smarty->assign('album',$album);

$smarty->display('/home/cust/netdotch/public_html/sisprocom_ch/tools/netgallery/admin/index.tpl');
?>[/php:1:2de15adf0c]
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Sep 10, 2004 7:15 am    Post subject: Reply with quote

nicht der pfad im argument für display() soll absolute sein.
der soll relativ zu $smarty->template_dir sein.

aber
$smarty->template_dir und $smarty->compile_dir sollten absolute pfade sein, damit smarty die files findet, egal von wo aus es aufgerufen wurde.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
adrianryser
Smarty n00b


Joined: 09 Sep 2004
Posts: 3
Location: Schweiz

PostPosted: Fri Sep 10, 2004 12:13 pm    Post subject: vielen dank Reply with quote

danke vielmals, jetzt hats funktioniert!

einen schönen tag wünsche ich und viele grüsse

adrian
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: German 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