Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 523125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:25:31+00:00 2026-05-13T08:25:31+00:00

In the framework I am working with, if I want to present data in

  • 0

In the framework I am working with, if I want to present data in a view I do this:

<h1><?php echo $this->header ?></h1>

Recently I discovered xTemplate and noticed it uses string placeholders, so the above code in a xTemplate would be:

<h1>{HEADER}</h1>

I always thought that a little php in the view was ok and was also faster than doing a str_replace, but I have recently started working with a designer and I think lot’s of php tags in the html might confuse him.

I would like to know your thoughts on this subject.

Thanks.

Note: This might be subjective but I really want to find out the best way or at least know all the pros and cons of both of these approaches.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:25:31+00:00Added an answer on May 13, 2026 at 8:25 am

    PHP is designed as a templating language. I see no point in creating template engines above template engine.

    Compare

     Hi, <b><?=$username?></b>
    
     Hi, <b>{username}</b>
    

    Is the first variant really complicated?

    If you try Smarty, you will be very surprized how complicated it is. It is pure EVIL: http://www.smarty.net/manual/en/language.function.foreach.php

     {foreach name=outer item=contact from=$contacts}
       <hr />
       {foreach key=key item=item from=$contact}
         {$key}: {$item}<br />
       {/foreach}
     {/foreach}
    

    Is it simpler to read than PHP’s foreachs? Don’t make me laugh.

    EVIL.
    Don’t use any template engines other than the PHP itself.
    Provide enough helpers functions to your designer and he will not complain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working with the Joomla framework and I have noticed that they use
I'm working on developing a javascript framework and I don't want anyone to be
I want to split my WordPress theme (I'm working from The Buffet Framework )
I'm new in silverlight and prism framework and I want to explore some working
I am working on a new PHP framework for personal use in future projects,
I'm faced with writing a framework to simplify working with a large and complex
I would like to host a Maven repository for a framework we're working on
I am working on implementing Zend Framework within an existing project that has a
I'm working on a test framework in Perl. As part of the tests, I
I'm working with the SerialPort class in the Compact Framework, but I can't recive

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.