PHP templates and which type to use?

PHP: Templates

Posted 17 August 2001 - 07:56 AM

I recently moved my site to PHP templates, http://www.xqu.cjb.net/ , using the basic template at http://www.users.f2s...q/phpbasic.php3 . I like this way of using templates, but it is so simple, and it lacks some features.
I have been reading the templates articles at http://www.phpbuilder.com/columns/ but none of these suit what I want but they are closer.
I have would like to know all the different template classes you get and some links.
I would like my site to be able to:
- Include php in the main template page
- Include php (using <? php )in the main content of the pages
- Be able to use " ' and without annoying escape sequences
- Fairly easy to configure
If anybody knows a template that will do all these would you please tell me that would be GREAT.
Thanks you very much in advance.
-Quizical.

Re: PHP: Templates

Posted 18 August 2001 - 04:53 AM

Im not very skilled at all, this is one of the first few things I have done with PHP and is one of the things that attracted me to PHP.
Althought if I am using a premade template I can almost always configure scripts from code that is already provided.

Re: PHP: Templates

Posted 19 August 2001 - 03:16 AM

But that is my problem.
I know I could customize it a bit too my needs,
but which one should i use, there is so many, PHPlib, Fasttemplates, and so many more I dont know about, so which one do I use, which one is best for my needs???

Re: PHP: Templates

Posted 19 August 2001 - 04:28 PM

I have found that using something similar to all of those templates without actually using a template works for me.

What I do is create a file that I wish to serve as a template. Then instead of using variables with curly braces, I just use a standard PHP variable in it's place. This way, I can throw code into that variable and it will execute. I have found that trying to put code into the other templates systems just doesn't allow for the execution of code in that place.

Re: PHP: Templates

Posted 19 August 2001 - 05:55 PM

well the way i make my templates personal is by using that variable to fill the varying space in each file...the main content if defined by something used in the URL...see http://www.upc.presbychurch.net/new/ the whole thing runs off of the variables defined, and includes various files containing data to replace that variable with -- and so the main content area is filled. Relatively simple to do.

Re: PHP: Templates

Posted 20 August 2001 - 02:32 AM

Yes, I do use the standard PHP variables ($content) and then put a require in the file that has the actual code part, but the problem with this is that I cannot ' " without using escape sequences and I cannot simply put PHP into the varibles I have to put a big bit of code to for example include a file into the main content section, so I was wondering if anybody knows a way areound this?

Re: PHP: Templates

Posted 20 August 2001 - 10:20 AM

to echo something or define a variable and allow " and ' without escaping:

echo <<<END_AT_THIS_TEXT_NEXT_TIME
note the immediate line break after TIME..it's significant, even a space there could mess the whole thing up. " and ' are definitely allowed without escaping..and also note the new line for the end tag
END_AT_THIS_TEXT_NEXT_TIME;

you can swap out END_AT_THIS_TEXT_NEXT_TIME with anything you want..but you want to make sure it won't be repeated in the middle of the beginning and the end..