Apr
21

Not PHP

Filed under: Asides | April 21st, 2005
Post

WordPress is not PHP, a basic template tutorial. (6)

6 Responses

  • Avatar

    Aaron Brazell | April 22nd, 2005 @ 10:13 am | Reply

    While I respect what the guy is trying to say, he is wrong in saying WP is not PHP. It is PHP. And the template tags, though called template tags, are PHP functions built by the WP team using PHP. It’s like saying a leopard isn’t a leopard but a cat.

    Ummm… yeah.

    It’s way too oversimplified.

    Current score: 0
  • Avatar

    MHobbit | April 22nd, 2005 @ 1:16 pm | Reply

    It’s like phpBB template variables. They’re built by the phpBB PHP files, yet they’re used in and surrounded by (X)HTML.

    Current score: 0
  • Avatar

    Amit Gupta | April 22nd, 2005 @ 1:27 pm | Reply

    Well, I don’t agree with you Aaron[& you can't give me negative rep here for arguing with you ;) ]. Even if its a PHP function call, can’t it be used as a template tag? Its static, its not changing & you use it as it is, copy paste. Then why all the fuss about it? Does WP necessarily have the overhead of a templating system like Smarty for proper templates? That would really affect the speed of WP.
    There’s nothing really wrong in using PHP function calls as template tags as WP does. If a designer don’t want to learn PHP to create themes, then its ok, he can simply copy-paste the tags, they are documented at the Codex at http://codex.wordpress.org/Templates. :)

    Current score: 0
  • Avatar

    hao2lian | April 22nd, 2005 @ 2:04 pm | Reply

    It is PHP since the underlying language used is PHP itself. Even though you can freely use (X)HTML, this is a direct benefit of PHP’s ability to interact so closely with (X)HTML. phpBB’s template variables differs in this respect since there’s an external script written to convert the phpBB template variables to actual values, while there’s no equivalent being done to Wordpress’s templates since they’re PHP calls already.

    Current score: 0
  • Avatar

    jerome | April 23rd, 2005 @ 11:35 pm | Reply

    Amit,
    It’s incorrect to imply that templates necessarily result in slower speeds. Smarty, for instance, only parses user templates once to create a cache file, which is basically a PHP file with all template tags replaced with PHP variables. This end result is the same as WordPress, but the designer (i.e. person editing the template) is insulated from having to work with PHP. Another example is LightPress, a template-based frontend replacement for WordPress that was recently benchmarked at over triple the speed of WordPress.

    Templates are a way of separating the engine code from the site design & layout. It’s a usability issue from the designer’s point of view. If your “template tags” are really just PHP code, then the designer has to worry about syntax: “Did I forget a semicolon?” And once code permeates the design, it inevitably spreads.

    I agree that a badly-designed template system would be slow. But I don’t see anyone suggesting the use of such a system.

    Current score: 0
  • Avatar

    Ka Webspy | June 7th, 2005 @ 9:17 pm | Reply

    I might be true that Wordpress is not PHP because wordpress is not really the PHP nor the PHP is the Wordpress. But the truth is Wordpress uses PHP and was built through PHP….

    Thanks for the tutorial.

    Current score: 0

Share your thoughts