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

Menü-Objekt-Problem

 
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
Carnage
Smarty Rookie


Joined: 05 Nov 2004
Posts: 7

PostPosted: Thu Dec 23, 2004 9:41 pm    Post subject: Menü-Objekt-Problem Reply with quote

Hi.

Und zwar habe ich folgende menu.php:
Code:
[...]
<a href="test.class.php">{#faq#}</a>
[...]


Nun würde ich diese Datei in welcher die Klasse drin ist aber gerne automatisch aufrufen lassen. Habe es zwar schon mit:
Code:
<a href="{faq->show}">{#faq#}</a>


Aber irgendwie will dass nicht.
Geht das überhaupt was ich vorhabe ?
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Fri Dec 24, 2004 8:37 am    Post subject: Reply with quote

ich hab jetzt wahrscheinlich nicht verstanden, was du genau willst, aber ich versuchs mal Wink

normalerweise (also quasi bei mir) greif ich auf variablen mit {$faq} zu, vielleicht liegts ja daran das {faq->show} ned geht.
Bist du dir außerdem sicher, das in {faq->show} etwas drinnsteht?

Schau einfach mal in Quelltext, dann weißt eh ob in die Variable leer ist oder nicht.

ich würds ja so machen

php:
$faq['url'] = "test.class.php";
$faq['text'] = "test-klasse";

assign("faq",$faq);

smarty:
<a href="{$faq.url}">{$faq.text}</a>

aber nachdem ich ned so genau weiß, was du machen willst, weiß ich ned ob dir das was nützt Wink

mfg Thomas
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
Carnage
Smarty Rookie


Joined: 05 Nov 2004
Posts: 7

PostPosted: Sat Dec 25, 2004 12:33 am    Post subject: Reply with quote

Naja, das war net wirklich mein Problem Smile.
Ich habe 2 Frage:

1.) Wenn ich nun per PHP $faq->show aufrufe wie kann ich über Smarty prüfen ob diese Methode/Eigenschaft nun gerade aufgerufen wird ?
Ich habe es zwar per:
Code:
{if $todo->show_all}


probiert, doch leider funktionierte dass nicht.

2.) Wenn ich ein Menü habe und eine php-Datei mit klassen. Wie kann ich über dieses Menü:
Code:
<a href="test.class.php">{#faq#}</a>


Eine Klasse mit der jeweiligen Eigenschaft aufrufen. Wie schon oben erwähnt habe ich:
Code:
<a href="{$faq->show}">{#faq#}</a>


Probiert und natürlich davor mit:
Code:
$smarty->register_object("faq",$faq);


diese Klasse in Smarty instanziert, doch leider funktionierte dies nicht.
Daher die Frage wie funktionieren diese beiden Sachen ?
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