Lord Yggdrasill;11018009 wrote:Perhaps it is time for me to use smarty or a professional template system, this one aint really doing good.
IMO, Smarty and other template systems for PHP are largely counter-productive, especially for programmers (as opposed to "designers"). You have to learn a second set of rules, syntax, and workarounds for something you could be doing directly in PHP, without the overhead.
PHP is perfectly suited for templating all on its own. That's basically the task it was created for.
template.php
<!doctype html>
<html>
<head>
<meta charset-utf-8>
<title> <?= $title ?> </title>
<head>
<body>
<article>
<h1> <?= $title ?> </h1>
<?= $content ?>
</article>
<aside>
<?= $sidebar ?>
</aside>
</body>
</html>
page.php
<?php
$title = "My PHP Page";
$content = "Hello, World!";
$sidebar = "whatever";
include( 'template.php' );
?>
Lord Yggdrasill;11018133 wrote:Sorry to have to double post in the topic. I find the url rewriting is not working for get forms, the query string is still messed up. One possible solution is to get rid of get forms, but are there's one problem. Sometimes I do not know what url I will be getting since the url is variable, not fixed. This happens when the form contains drop down select/option elements, and the url depends on these values. What am I supposed to do in this case? I heard its possible to use javascript to get this to work, but I do not know how to do it. Is there another way?
Are you still talking about the URLs to your scripts/stylesheets (same as earlier in this thread)? I don't understand how the query string would be interfering with what we've discussed so far (or why there would be a query string in those URLs in the first place). Or are you talking about something else (you mentioned URL rewriting and form submissions)? Can you clarify/ give an example?