Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> ENGINE
eS...
post
Post #1





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


witam
wiem ze są arty na temat engine, ale szczerze mówiąc to nie zabardzo mi wychodzi czytanie w necie (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif)

ale chodzi mi o to.
1.od strony teorii, o czym sie uczyć, aby w przyszłosci stworzyc swój engine??(klasy i obiekty??)
2.czy mozna skądś sciagnąć gotowy engine??
3. hmmm tutaj zamieszczam podziękowania (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 16)
MaKaO
post
Post #2





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Głogów

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


Tu znajdziesz coś co powinno Ci pomóc... Bardzo fajny artykuł na temat engine :-)
Go to the top of the page
+Quote Post
eS...
post
Post #3





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


8) oka thx
a wie ktoś czy mozna sciagnąć gotowe engine?? prosciej by mi było to zrobić mając skrypt (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
MaKaO
post
Post #4





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Głogów

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


Przecież tam masz gotowe fragmenty kodu :wink:
Go to the top of the page
+Quote Post
eS...
post
Post #5





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


oka moze jakoś to zrozumiem (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)





...........................POZDRO.........................
Go to the top of the page
+Quote Post
eS...
post
Post #6





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


yo a czy mozna engine bez SQL'a (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
bo nie mam konta z sql;em (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
MaKaO
post
Post #7





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Głogów

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


Bez SQL'a będzie ciężko, myśle że [to] może Ci w jakiś sposób pomóc... :wink:
Go to the top of the page
+Quote Post
[Regis]
post
Post #8





Grupa: Zarejestrowani
Postów: 100
Pomógł: 0
Dołączył: 19.04.2003
Skąd: Wrocław

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


Jak planujesz cos zrobic, to jednak polecam zaopatrzyc sie w konto z jakims SQL-em - takie konta mozna miec za 40zl rocznie w promocji, a bez bazy danych raczej porzadnej strony sie nie da zrobic - tzn. php bez bazy danych nie rozwinie w pelni skrzydel (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
eS...
post
Post #9





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


hmmm no to może wytłumaczycie, albo dacie mi kod jakiegos prostego szablonu (nie engine tylko najprostszy szablon)
Go to the top of the page
+Quote Post
MaKaO
post
Post #10





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Głogów

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


class.template.php
------------------------------------
[php:1:3ba2db3e88]<?php
class Template {
var $tmpl;
var $dane;
function Template ($name) {
$this->tmpl = implode('', file($name));
$this->dane = Array();
}
function add($name, $value = '') {
if (is_array($name)) {
$this->dane = array_merge($this->dane, $name);
} else if (!empty($value)) {
$this->dane[$name] = $value;
}
}
function execute() {
return preg_replace('/{([^}]+)}/e', '$this->dane["1"]', $this->tmpl);
}
}
?>[/php:1:3ba2db3e88]

test.php
------------------------------------
[php:1:3ba2db3e88]<?php
include 'class.template.php';
$tmpl = new Template('test.tpl');
$tmpl->add('title', 'tytuł strony');
$tmpl->add('autor', 'imie autora');
$tmpl->add('charset', 'iso-8859-2');
$dane = Array('imie'=> 'Marcin', 'podpis'=>'jakiś tam podpis');
$tmpl->add($dane);
echo $tmpl->execute();
?>[/php:1:3ba2db3e88]

test.tpl
------------------------------------
Kod
<html>

<head>

<title>{title}</title>

<meta http-equiv="Content-type" content="text/html; charset={charset}">

</head>

<body>

<p>Autorem strony jest {autor}</p>

<p>Witaj {imie}</p>

<p>{podpis}</p>

</body>

</html>


No to jest taki banalny :-) A jeżeli chodzi o najlepszy system szablonów, to SMARTY. :-)
Go to the top of the page
+Quote Post
eS...
post
Post #11





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


oka kumam dzięki
ale teraz jak mam np podstrony menu.php (jak je wstawić bo nie wiem) no i np jeszcze kontakt.php. info.php jak to powstawiać no bo przeciez nie w array()
Go to the top of the page
+Quote Post
MaKaO
post
Post #12





Grupa: Zarejestrowani
Postów: 70
Pomógł: 0
Dołączył: 3.05.2003
Skąd: Głogów

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


Kod
$tmpl -> add('menu', implode("", file('modules/menu.php')));

$tmpl -> add('main', implode("", file('modules/$page.php')));

{menu}, {main}
Go to the top of the page
+Quote Post
eS...
post
Post #13





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


czyli[php:1:0394c1c586]<?php

<?php
include 'class.template.php';
$tmpl = new Template('test.tpl');
$tmpl->add('title', 'tytuł strony');
$tmpl->add('autor', 'imie autora');
$tmpl->add('charset', 'iso-8859-2');
$tmpl -> add('menu', implode("", file('modules/menu.php')));
$tmpl -> add('main', implode("", file('modules/$page.php')));
$dane = Array('imie'=> 'Marcin', 'podpis'=>'jakiś tam podpis');
$tmpl->add($dane);
echo $tmpl->execute();
?>

?>[/php:1:0394c1c586]
Go to the top of the page
+Quote Post
Omega
post
Post #14





Grupa: Zarejestrowani
Postów: 273
Pomógł: 0
Dołączył: 5.05.2003
Skąd: Mazury

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


Ale sprubój Smarty, sa proste i bardzo dobre...
Go to the top of the page
+Quote Post
eS...
post
Post #15





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


oka poprobuje te smarty, ale mam nadzieje ze są bez MySQL, znaczy że nie trzeba bazy danych, bo nie mam takiego konta (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
Omega
post
Post #16





Grupa: Zarejestrowani
Postów: 273
Pomógł: 0
Dołączył: 5.05.2003
Skąd: Mazury

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


Tak są bez baz danych, a jakbyś czegoś nie wiedziała to chętnie pomogę... (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
eS...
post
Post #17





Grupa: Zarejestrowani
Postów: 367
Pomógł: 2
Dołączył: 4.03.2003
Skąd: C:/Windows/Temp

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


oka spox, ale musze dojechać jak zwykle do domu żeby sie za to zabrać
ale napewno sprawdzem (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) 8) jak co to bede pytał TU
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 9.10.2025 - 17:10