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? - Neuland, Hilfe für Windows User
Goto page 1, 2  Next
 
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
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 9:52 am    Post subject: Smarty? - Neuland, Hilfe für Windows User Reply with quote

Hi ihr Pro's. Also ich hab von nem guten Freund diese Engine Smarty empfohlen bekommen, und ich wollt mich gerne damit auseinandersetzen. Also hab ich mir das Paket runtergeladen und mir die Dokumentation angesehen. Am Punkt Installation hats dann auch schon aufgehört, als ich feststellen, dass diese für ein Unix System geschrieben ist. Leider bin ich aber, was Linux und ähnlich Dinge angeht noch Neuling, sodass ich auf die Windows Plattform zurückgreifen muss. Ich habe zwar mal Suse Linux bei mir installiert, weils mich interresiert hat, aber dennoch gehts noch nich soweit, dass ich nicht weis wie man einen Webserver o.Ä. aufsetzt. Deswegen würd ich euch bitten, dass mir jemand erklärt, wie ich diese Engine auf meinem System lauffähig mache, bzw. ob ich einen speziellen Webserver nehmen soll (benutze lokal den Apache).
Danke schonma im Vorraus

Btw: Php Kenntnisse sind seöbstverständlich vorhanden, weil es ja sonst eher wenig Sinn machen würde Wink
Back to top
View user's profile Send private message Send e-mail
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Mon Nov 29, 2004 10:28 am    Post subject: Reply with quote

Hallo dOr|K3nnY,
leg die Smartydatei-2.6.6 ( die Version, die du dir auf deinen Rechner geladen hast) in den Ordner Htdocs und ruf in deinem Browser folgende Url auf
http://localhost/smarty_2.6.6/demo/index.php.
Dann m?sstest du schon die Testseite sehen !
________
herbal vaporizers


Last edited by halloweb on Wed Feb 02, 2011 7:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 10:38 am    Post subject: Reply with quote

Ahh okay danke, zumindest funktioniert das schonmal! Is wenigstens ein Anfang. Also ich hab jetz ma bissl so weitergelesen in der Doc, naja und ich mein gut Syntaxerklärung und was dazu gehört, is ja ganz fein, aber wie funktioniert nun die Programmierung mit Smarty?
Back to top
View user's profile Send private message Send e-mail
halloweb
Smarty Regular


Joined: 23 Nov 2004
Posts: 35

PostPosted: Mon Nov 29, 2004 10:44 am    Post subject: Reply with quote

Quote:
wie funktioniert nun die Programmierung mit Smarty?


In Smarty-2.6.6/Demo/Templates/ ( index.tpl , header.tpl , footer.tpl , )

... kann das Template erstellt werden !

In Smarty-2.6.6/Demo/index.php

... kommt dein PHP-Code rein !

________
mexico hotels

Last edited by halloweb on Wed Feb 02, 2011 7:06 pm; edited 2 times in total
Back to top
View user's profile Send private message
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Mon Nov 29, 2004 10:45 am    Post subject: Reply with quote

Smarty ist nicht für die Programmierung da, das musst du wie vorher auch in PHP machen. Smarty ist keine Programmiersprache wie Python oder so...
Smarty ist nur dazu da, dir bei der Ausgabe der Daten zu helfen... und das macht es verdammt gut.
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 10:56 am    Post subject: Reply with quote

Okay das heist also ich könnte jetz einfach ma so meine scripte die ich mit php entwickelt hab, nehmen, und die in die index.php reinschreiben, und dann - wie das auch immer gehen soll - mit Hilfe von Smarty so verarbeiten lassen, dass es mir ne korrekte Ausgabe der Ermittelten Inhalte in dem Script gibt - schön und gut, is ja recht allgemein gehalten.
Machen wir doch ma`n konkretes Beispiel:
Eine simple Datenbank mit einer Tabelle "mitglieder (id, name, nachname, wohnort) soll also ausgelesen werden und in einer übersichtlichen Tabelle auf der Seite erscheinen. Ich denke den php code dazu muss ich nicht erst aufschreiben, der wird jedem bekannt sein.
Gehen wir also ran, an die Trennung von Code und Design. Normalerweise würde ich den php code in die Html bzw. php datei, weis ihc denn "mitglieder.php" reinschreiben, und das würde gehen. So aber Smarty soll das jetzt unterbinden... Was tue ich also als erstes, um das hinzukriegen?
Back to top
View user's profile Send private message Send e-mail
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Mon Nov 29, 2004 11:15 am    Post subject: Reply with quote

Sag mal, könnte es sein, dass du diese Seite noch nicht gefunden hast?
http://smarty.php.net/crashcourse.php

Auf der Seite ist aller schön einfach erklärt...

Grüzi, Smile
McSodbrenner
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 11:24 am    Post subject: Reply with quote

Gibts das auch auf Deutsch? Wenn ja wo? In der deutschen Documentation is das leider nicht zu finden
Back to top
View user's profile Send private message Send e-mail
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Mon Nov 29, 2004 11:34 am    Post subject: Reply with quote

Vielleicht hilft dir das:

http://paland.net/blog/index.php/2004/11/24/347-phpmysql-anwendungen-ein-pladoyer-fur-smarty

edit: Die URL verweist jetzt auf die Perma-Adresse
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!


Last edited by McSodbrenner on Tue Feb 01, 2005 11:18 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 12:01 pm    Post subject: Reply with quote

Okay also ich hab ma versucht, das zu verstehen und dann das erste Beispiel aus dem Crashcourse gemacht.
Das Ergebnis sieht so aus:
Warning: Smarty error: unable to read resource: "index.tpl" in c:\phpdev\www\smarty\libs\Smarty.class.php on line 1088
also die index.tpl hab ich erstellt, nich dass wir uns missverstehen, und ich hab halt das reingeschrieben was da in dem crashcourse stand.
Scheinbar will der die Datei nicht lesen, aber warum? Und wie mach ich, dass der die liest?
Back to top
View user's profile Send private message Send e-mail
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Mon Nov 29, 2004 12:32 pm    Post subject: Reply with quote

Dann poste doch mal deinen Code und deine Verzeichnisstruktur, dann sehen wir uns das mal an.
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 1:02 pm    Post subject: Reply with quote

sry, hat bissl gedauert, war ma eben beim friseur Wink

erstma die verzeichnisstruktur:
also index.php und index.tpl sowohl die benötigten libfiles von smartysind gespeichert in: C:/phpdev/www/smarty/libs

die dateien: index.php:
Code:
<html>
<head>
<title>Document Title</title>
</head>
<body>
<?php
 include('Smarty.class.php');

// create object
$smarty = new Smarty;

// assign some content. This would typically come from
// a database or other source, but we'll use static
// values for the purpose of this example.
$smarty->assign('name', 'george smith');
$smarty->assign('address', '45th & Harris');

// display it
$smarty->display('index.tpl');
?>
</body>
</html>


die index.tpl:
Code:
<html>
<head>
<title>User Info</title>
</head>
<body>

User Information:<p>

Name: {$name}<br>
Address: {$address}<br>
</body>
</html>



bitte!
Back to top
View user's profile Send private message Send e-mail
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Mon Nov 29, 2004 1:18 pm    Post subject: Reply with quote

hast du schon alle einstellungen für smarty gemacht? dateirechte vergeben? ordner angelegt?

wenn nicht:
http://smarty.php.net/manual/de/installing.smarty.basic.php
http://smarty.php.net/manual/de/installing.smarty.extended.php

ganz kurz, folgendes musst du mal auf jeden fall einstellen:
Code:

$smarty = new Smarty;

//Verzeichnis in dem die templates liegen
$smarty->template_dir = '/web/www.mydomain.com/smarty/guestbook/templates/';
//Verzeichnis für die "kompilierten" templates
$smarty->compile_dir = '/web/www.mydomain.com/smarty/guestbook/templates_c/';
//Konfigurationsdateien
$smarty->config_dir = '/web/www.mydomain.com/smarty/guestbook/configs/';
//Cache-Verzeichnis
$smarty->cache_dir = '/web/www.mydomain.com/smarty/guestbook/cache/';

//ein test:
$smarty->assign('name','Ned');
$smarty->display('index.tpl');


Dateirechte:

Code:

//wobei nobody und nogroup der benutzer/gruppe is unter dem dein server läuft. außer du verwendest windows, dann brauchst das eh ned.
chown
nobody:nobody /web/www.mydomain.com/smarty/guestbook/templates_c/
chmod 770 /web/www.mydomain.com/smarty/guestbook/templates_c/

chown nobody:nobody /web/www.mydomain.com/smarty/guestbook/cache/
chmod 770 /web/www.mydomain.com/smarty/guestbook/cache/


so far, Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
dOr|K3nnY
Smarty Rookie


Joined: 29 Nov 2004
Posts: 8

PostPosted: Mon Nov 29, 2004 1:26 pm    Post subject: Reply with quote

Jo also Einstellungen hab ich keine gemacht, weil halloweb hat gesagt, ich soll die dateien einfach ma reinkopieren ni den htdocs ordner(is ja bei mir der www ordner), na aber ich werd mich gleich ma ransetzen und das probieren.
Zu dem Problem: Ich hab mir ma die Verzeichnis Struktur von der demo angeschaut, und da sind zusätlihc noch die Ordner templates_c und templates drinne. In templates_c war nix drinne, aber in templates war die tpl datei drinne. Das hab ich dann auch bei mir probiert, aber ohne dem ordner templates_c. Das hat nicht funktioniert, als ich jedoch dem Ordner templates_c angelegt habe, gings (also es geht jetzt WIRKLICH Smile)

Nur so recht ne Erklärung hab ich dafür nicht. Aber ihr wisst doch bestimmt warum. Und muss ich jetzt die tpl datei immer in den templates ordner schieben?
Back to top
View user's profile Send private message Send e-mail
McSodbrenner
Smarty Pro


Joined: 19 Sep 2004
Posts: 101
Location: Hamburg, Germany

PostPosted: Mon Nov 29, 2004 1:27 pm    Post subject: Reply with quote

Pack einfach das Template in einen Ordner names "templates", dann sollte es gehen.
_________________
Grüzi, Smile
Christoph

My sweet home: www.webboarder.de
Do not visit!! It is private!! And it's mine!
Back to top
View user's profile Send private message Visit poster's website
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
Goto page 1, 2  Next
Page 1 of 2

 
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