![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 18 Pomógł: 0 Dołączył: 25.08.2007 Ostrzeżenie: (0%) ![]() ![]() |
Hello,
piszę sobie takie jąderko stronki. moduły wywołuję w ten sposób: index.php?module=articles <- taki adres szuka pliku articles.php w katalogu modules i jak jest to go includuje na stronke. Opt sobie zainstalowałem, w index.php to działa, a w modułach nie. Czemu? Dostaje error: "Fatal error: Call to a member function assign() on a non-object in /home/xavipl/domains/xavi.pl/public_html/xaff/articles.php on line 2" Na ircu powiedziano mi, że to znaczy, że $tpl nie jest obiektem, a czemu? Kod wygląda tak:
Funcion to proste:
Domyślam, się, że chodzi o ścieżki do biblioteki opt, ale jak to naprawić aby działało? Pozdrawiam Błąd powstaje gdy używam assign w modułach:( articles.php to: <php> <?php $tpl -> assign('Komunikat', 'To jest moduł articles.php'); ?> </php> Ten post edytował Xaviere 28.10.2007, 14:28:00 |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 23 Pomógł: 2 Dołączył: 26.04.2007 Ostrzeżenie: (0%) ![]() ![]() |
Głowy nie dam, ale wydaje mi się, że po prostu chodzi o to, że to jest wszystko w funkcji include_module, która nie widzi zmiennych globalnych. Spróbuj na przykład na początku tej funkcji wpisać "global $tpl;"
|
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 18 Pomógł: 0 Dołączył: 25.08.2007 Ostrzeżenie: (0%) ![]() ![]() |
include_module to zupełnie co innego.
Dobra, tyle o ile, ale teraz dostaje: Fatal error: Uncaught exception 'optException' with message '"articles.tpl" not found in ../templates directory.' in /home/xavipl/domains/xavi.pl/public_html/xaff/modules/articles.php:6 Stack trace: #0 /home/xavipl/domains/xavi.pl/public_html/xaff/opt/opt.class.php(929): optErrorMessage(Object(optClass), 256, '"articles.tpl" ...', 6, 'articles.tpl') #1 /home/xavipl/domains/xavi.pl/public_html/xaff/opt/opt.class.php(967): optClass->error(256, '"articles.tpl" ...', 6) #2 /home/xavipl/domains/xavi.pl/public_html/xaff/opt/opt.class.php(735): optClass->needCompile('articles.tpl') #3 /home/xavipl/domains/xavi.pl/public_html/xaff/opt/opt.class.php(641): optClass->fetch('articles.tpl', true) #4 /home/xavipl/domains/xavi.pl/public_html/xaff/modules/articles.php(6): optClass->parse('articles.tpl') #5 /home/xavipl/domains/xavi.pl/public_html/xaff/includes/function.php.xavi.riff(21): require_once('/home/xavipl/do...') #6 /home/xavipl/domains/xavi.pl/public_html/xaff/index2.php(51): include_module('articles') #7 {main} thrown in /home/xavipl/domains/xavi.pl/public_html/xaff/modules/articles.php on line 6 Do rzeczy skrypt articles.php wygląda tak:
A drzewo katalogowe tak: ----Public html---- --modules articles.php --templates articles.tpl --templates_c I jak teraz z articles.php wyjść do templates? -------------Do zamknięcia, działa ![]() Ten post edytował Xaviere 28.10.2007, 19:59:31 |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 24.07.2025 - 19:56 |