|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Jul 12, 2004 1:21 pm Post subject: Caching |
|
|
Hallo zusammen,
ich arbeite seit kurzem mit template caching.
Nun habe ich folgende Scripts:
Global.php
[php:1:78ebfbee8b]
<?php
/* 3rd Party Klassen einbinden */
set_include_path( get_include_path() .PATH_SEPARATOR.
dirname( realpath( "./_php/Smarty-2.6.2/Smarty.class.php"))
);
require_once( "Smarty.class.php");
/* einzelnen eigene Module einbinden */
include( "_php/Folder.php");
include( "_php/FolderContent.php");
include( "_php/FileSystemBrowser.php");
include( "_php/FileSystemBrowserProfile.php");
/* Template Objekt initialisieren */
$oTemplate = new Smarty();
$oTemplate->template_dir = 'Templates/';
$oTemplate->compile_dir = 'Templates/_compiled/';
$oTemplate->config_dir = 'Templates/_configs/';
$oTemplate->cache_dir = 'Templates/_cached/';
$oTemplate->chaching = true;
$oTemplate->debugging = true;
/* Globale Variablen/Einstellungen */
?>
[/php:1:78ebfbee8b]
Index.php
[php:1:78ebfbee8b]
<?php
include( "_php/Global.php");
$oTemplate->assign( "sPageTitel", "FileSystemBrowser");
if ( !empty( $_GET["path"] )) {
$sContentTemplate = "FileSystemBrowser.tpl";
// Unterseiten
.
.
.
} else {
// Startseite
$sContentTemplate = "Starter.tpl";
}
$oTemplate->assign( "sContentTemplate", $sContentTemplate);
$oTemplate->display( "Index.tpl", $sContentTemplate . @$_GET["path"]);
?>
[/php:1:78ebfbee8b]
Ich rufe alle meine Seiten per "Index.php" auf und übergebe anhand einer path variable welche Datei nun innerhalb des ganzen verwendet werden soll.
Wie im Manual beschrieben arbeite ich mit TemplateIds da ich mehrere Caches für eine Datei verwenden möchte.
Warum aber werden nie dateien im TPL-Cache-Dir erzeugt?
Wo speichert der mir die Multiple-Cache-Dateien hin?
Wenn ich cachen einschalte und die TPL-ID weglasse, werden dateien im TPL-Dir erstellt.
Wo liegt mein Fehler? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Mon Jul 12, 2004 1:29 pm Post subject: |
|
|
ich würde sagen der fehler liegt in "$smarty->chaching=true", das müsste "caching" heissen.
in "templates_c" werden immer dateien erzeugt, egal ob caching an oder aus ist. in templates_c liegen die compilierten templates (php-code).
in "cache" werden nur dateien erzeugt wenn caching aktiviert ist. hier liegt dann quasi html-code. |
|
Back to top |
|
kills Smarty Elite
Joined: 28 May 2004 Posts: 493
|
Posted: Mon Jul 12, 2004 2:13 pm Post subject: |
|
|
messju wrote: | ich würde sagen der fehler liegt in "$smarty->chaching=true", das müsste "caching" heissen.
|
ach mist vertippt
danke daran lags! |
|
Back to top |
|
|
|
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
|