PHP: Templates

PHP templates and which type to use?

Page 1 of 1

14 Replies - 3251 Views - Last Post: 26 August 2001 - 02:51 PM Rate Topic: -----

#1 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

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.

Is This A Good Question/Topic? 0
  • +

Replies To: PHP: Templates

#2 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

Re: PHP: Templates

Posted 17 August 2001 - 07:01 PM

it depends really on how skilled you are, but you may not be able to, code yourself a template system.  It's relatively simple to do...just very time consuming and rather involved.
Was This Post Helpful? 0
  • +
  • -

#3 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

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.
Was This Post Helpful? 0
  • +
  • -

#4 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

Re: PHP: Templates

Posted 18 August 2001 - 11:06 AM

so in this case then edit the premade stuff to suit your needs -- that wouldn't take so much as you're not starting from scratch :)
Was This Post Helpful? 0
  • +
  • -

#5 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

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???
Was This Post Helpful? 0
  • +
  • -

#6 tsmoke  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 50
  • Joined: 20-April 01

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.

Try it out and tell me what you think.

tsmoke

Was This Post Helpful? 0
  • +
  • -

#7 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

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.
Was This Post Helpful? 0
  • +
  • -

#8 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

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?
Was This Post Helpful? 0
  • +
  • -

#9 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

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..

Was This Post Helpful? 0
  • +
  • -

#10 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

Re: PHP: Templates

Posted 20 August 2001 - 10:42 AM

Sorry but I did not understand a word of that.
Was This Post Helpful? 0
  • +
  • -

#11 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

Re: PHP: Templates

Posted 21 August 2001 - 02:37 PM

Well I finally caught on, and it works, great, only problem is it takes 10 times longer to load.
Was This Post Helpful? 0
  • +
  • -

#12 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

Re: PHP: Templates

Posted 22 August 2001 - 08:54 AM

shouldn't be any lost speed due to using that code..perhaps it's something else :/
Was This Post Helpful? 0
  • +
  • -

#13 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

Re: PHP: Templates

Posted 22 August 2001 - 11:10 AM

Im not sure,
maybe it just took a while to reach the host,
im not sure.
Only other thing I want now is how do i put some php in that?
Was This Post Helpful? 0
  • +
  • -

#14 Mark  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 93
  • Joined: 06-August 01

Re: PHP: Templates

Posted 24 August 2001 - 11:12 PM

it depends on how you've coded it..if you're including files just 'break into' php using <?php ?> tags.
Was This Post Helpful? 0
  • +
  • -

#15 Quizzical  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 172
  • Joined: 05-August 01

Re: PHP: Templates

Posted 26 August 2001 - 02:51 PM

Its a bit complicated, but im sure I can find a way around it. Its easier for me to work out than explain.
Thanks for all the help, it works a treat and tons better.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1