Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z klasa
post
Post #1





Grupa:
Postów: 0
Pomógł:
Dołączył: --

Ostrzeżenie: (0%)
-----


mam taka klase (nie jest moja)

[php:1:c6d1ae1424]<?
<?php
class Template {

var $unparsed = array(0 => '');
var $parsed = '';
var $blocks = array('default' => '');

function template($plik) {
$this -> unparsed = @file('tpl/'.$plik.'.tpl');
}

function parse() {
$this -> parsed = '';
$cnt = count($this -> unparsed);
for($i = 0; $i <= $cnt; $i++) {
$tekst = $this -> unparsed[$i];
$found = array();
if(preg_match_all("#{(.+?)}#is", $tekst, $found)) {
foreach($found[1] as $block) {
$block_names[] = '{'.$block.'}';
$block_values[] = &$this -> blocks[$block];
}
$tekst = str_replace($block_names, $block_values, $tekst);
}
$this -> parsed .= $tekst;
}
}
}
?>
[/php:1:c6d1ae1424]

i jak chce ja dolaczyc zeby potem uzyc to wywala mi taki blad

Cytat
Fatal error: Cannot redeclare class template in C:wwwtemplate_class.php on line 2


o co chodzi questionmark.gif
Go to the top of the page
+Quote Post

Posty w temacie
- Anonymous   problem z klasa   28.05.2004, 22:37:11
- - theoden   Komunikat   28.05.2004, 22:46:10
- - Anonymous   <? - to ze jest dwa razy to przypadek (jak wkla...   28.05.2004, 22:57:47


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 14:22