PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > template usage
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
template usage

Réponse
 
LinkBack Outils de la discussion
Vieux 12/10/2008, 11h09   #1
Alain Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut template usage

Hi,

i would like to know if you are a lot to use PHP templates for your web
application or web sites ?
if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
and for which reason ? what is/are the advantages over the others ?

thanks a lot,

--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

  Réponse avec citation
Vieux 12/10/2008, 11h32   #2
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] template usage

On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> Hi,
>
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?
>
> thanks a lot,
>

I wouldn't really call them templates, they're more libraries, and they
all have their individual uses. Generally, your use of them will depend
on what you actually want.

Can you explain a few details of what you are actually looking to do?


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 12/10/2008, 11h33   #3
Alain Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] template usage

I'm just reading a book on PHP and they promote quite heavily smarty as
template designer tool for presenting information and data to users.

they absolutly do not talk about pear and i'm a little surprised. That's why
i'm wondering who use what and for which reason.

Basically let's say for data/information presentation to end user...what is
the best lib (pear, smarty....) ?

On Sun, Oct 12, 2008 at 11:32 AM, Ashley Sheridan
<ash@ashleysheridan.co.uk>wrote:

> On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> > Hi,
> >
> > i would like to know if you are a lot to use PHP templates for your web
> > application or web sites ?
> > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > and for which reason ? what is/are the advantages over the others ?
> >
> > thanks a lot,
> >

> I wouldn't really call them templates, they're more libraries, and they
> all have their individual uses. Generally, your use of them will depend
> on what you actually want.
>
> Can you explain a few details of what you are actually looking to do?
>
>
> Ash
> www.ashleysheridan.co.uk
>
>



--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

  Réponse avec citation
Vieux 12/10/2008, 12h03   #4
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] template usage

On Sun, 2008-10-12 at 11:33 +0200, Alain Roger wrote:
> I'm just reading a book on PHP and they promote quite heavily smarty as
> template designer tool for presenting information and data to users.
>
> they absolutly do not talk about pear and i'm a little surprised. That's why
> i'm wondering who use what and for which reason.
>
> Basically let's say for data/information presentation to end user...what is
> the best lib (pear, smarty....) ?
>
> On Sun, Oct 12, 2008 at 11:32 AM, Ashley Sheridan
> <ash@ashleysheridan.co.uk>wrote:
>
> > On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> > > Hi,
> > >
> > > i would like to know if you are a lot to use PHP templates for your web
> > > application or web sites ?
> > > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > > and for which reason ? what is/are the advantages over the others ?
> > >
> > > thanks a lot,
> > >

> > I wouldn't really call them templates, they're more libraries, and they
> > all have their individual uses. Generally, your use of them will depend
> > on what you actually want.
> >
> > Can you explain a few details of what you are actually looking to do?
> >
> >
> > Ash
> > www.ashleysheridan.co.uk
> >
> >

>
>

I'm not sure comparing Pear and Smarty is really how to go about it.
It's a bit like comparing a apples and oranges. Smarty is indeed a
template/presentation framework, but Pear is more a library of
components (as is phplib) which offers some presentation components, but
isn't solely designed towards that purpose. Personally, if I were you,
I'd go with Smarty for the time being, as it has been designed as a
template engine, so it should be easier to get to grips with.


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 12/10/2008, 16h19   #5
cecilomar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: template usage

On Oct 12, 5:09am, raf.n...@gmail.com ("Alain Roger") wrote:
> Hi,
>
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?
>
> thanks a lot,
>
> --
> Alain
> ------------------------------------
> Windows XP SP3
> PostgreSQL 8.2.4 / MS SQL server 2005
> Apache 2.2.4
> PHP 5.2.4
> C# 2005-2008


I use Joomla as my Content Manager System (CMS) mainly because the
template system they use makes it so easy to edit or, my choice, to
create it from scratch.
  Réponse avec citation
Vieux 12/10/2008, 17h19   #6
Tree*Rat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: template usage

cecilomar <cecilomar@gmail.com> wrote in news:4fe11969-c869-4f04-b269-
1b99abfbd12a@m32g2000hsf.googlegroups.com:


>
> I use Joomla as my Content Manager System (CMS) mainly because the
> template system they use makes it so easy to edit or, my choice, to
> create it from scratch.



Joomla may be popular but is to complex for general use. Its also a cms not
a template or template engine.

Smarty is the very good template system.
  Réponse avec citation
Vieux 12/10/2008, 19h04   #7
Nathan Rixham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: template usage

Alain Roger wrote:
> Hi,
>
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?
>
> thanks a lot,
>


I'd vote smarty or using xslt; smarty is very good and nine out of 10
designers I know prefer it.
  Réponse avec citation
Vieux 12/10/2008, 19h43   #8
Robert Cummings
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] template usage

On Sun, 2008-10-12 at 11:09 +0200, Alain Roger wrote:
> Hi,
>
> i would like to know if you are a lot to use PHP templates for your web
> application or web sites ?
> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> and for which reason ? what is/are the advantages over the others ?


I use TemplateJinn

Unlike almost every other template engine out there it doesn't require
the framework be instantiated at runtime. It can be used to generate
static HTML files or it can be used in conjunction with InterJinn or
other frameworks. For instance, I use TemplateJinn to organize and build
my MediaWiki skins too. Usually when I create a template I pull out into
separate file logically distinct layout elements. For example the header
is in it's own template, any layout panes such as banner, left column,
right column, footer, and content area are also in their own file. Then,
I use a template that groups these together where I want them.
Additionally, for often use elements I will create a custom tag so that
I can just use a single tag to simpify and centralize rendering. An
example being MediaWiki's concept of a portlet. For these I just do:

<mw:portlet>
My content goes here
</mw:portlet>

This generates the wrapping divs for the portlet that enables easy CSS
customization and future proofs my design so that if ever I want more
elements to the portlet design I can just change the custom tag code and
recompile the skin. MediaWiki never has to know anything about InterJinn
or TemplateJinn or that the skin it is using was create via a template
engine.

Interestingly there was a recent thread about frameworks and someone
posted a blog where some guy did a benchmark using various frameworks.
Well "Hello World" if done in InterJinn would probably be done as a
static template compilation (one expects the developer to use the right
framework tool), and thus would be on par with Apache's static content
load (faster than PHP). In other words the benchmark is a load of crap
since if you use a tool properly there are ways to make it perform while
still having the convenience of a Framework. As such, TemplateJinn can
be leveraged via InterJinn so that static content pages use the same
layout as the entire site but for which the layout was generated at site
compilation time and can be requested subsequently without invoking the
PHP engine. My guess though, is that the guy would have implemented
"Hello World" with InterJinn via a module instead of using the
appropriate framework tool just so he could crap on frameworks some
more

The downside... for some anyways... of the TemplateJinn system, is that
you need to be comfortable editing your HTML by hand. There's no WYSIWYG
for custom tags. Personally, I prefer hand crafting my HTML layouts. I
find the browser itself to be the best available WYSIWYG.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

  Réponse avec citation
Vieux 12/10/2008, 19h48   #9
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: template usage

On Sun, 2008-10-12 at 18:04 +0100, Nathan Rixham wrote:
> Alain Roger wrote:
> > Hi,
> >
> > i would like to know if you are a lot to use PHP templates for your web
> > application or web sites ?
> > if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> > and for which reason ? what is/are the advantages over the others ?
> >
> > thanks a lot,
> >

>
> I'd vote smarty or using xslt; smarty is very good and nine out of 10
> designers I know prefer it.
>

XSLT is for transforming XML documents, so not good for use as a PHP
template!


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Vieux 12/10/2008, 20h03   #10
Nathan Rixham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: template usage

Ashley Sheridan wrote:
> On Sun, 2008-10-12 at 18:04 +0100, Nathan Rixham wrote:
>> Alain Roger wrote:
>>> Hi,
>>>
>>> i would like to know if you are a lot to use PHP templates for your web
>>> application or web sites ?
>>> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
>>> and for which reason ? what is/are the advantages over the others ?
>>>
>>> thanks a lot,
>>>

>> I'd vote smarty or using xslt; smarty is very good and nine out of 10
>> designers I know prefer it.
>>

> XSLT is for transforming XML documents, so not good for use as a PHP
> template!
>
>
> Ash
> www.ashleysheridan.co.uk
>


I guess it depends how you program, personally I like to program
everything API style nowadays, dumping out my script output/objects as
XML then transforming where needed with XSL; you can do it client side
or server side using http://php.net/manual/en/book.xsl.php - it is a
nice portable way of doing things (especially when having multiple front
ends (or using the same system for multiple sites), however as a
standard stick these variables into this bit of the (x)html then a
conventional "template engine" is what you need.

  Réponse avec citation
Vieux 12/10/2008, 20h17   #11
Micah Gersten
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: template usage

The problem with smarty is that they are still using PHP4 as their main
language so they cannot take advantage of speed improvements in PHP5.
So, my suggestion is that if you're stuck with PHP4, go with smarty,
otherwise, find another engine that's up to date.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Nathan Rixham wrote:
> Alain Roger wrote:
>> Hi,
>>
>> i would like to know if you are a lot to use PHP templates for your web
>> application or web sites ?
>> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
>> and for which reason ? what is/are the advantages over the others ?
>>
>> thanks a lot,
>>

>
> I'd vote smarty or using xslt; smarty is very good and nine out of 10
> designers I know prefer it.
>

  Réponse avec citation
Vieux 12/10/2008, 23h49   #12
Ashley Sheridan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Re: template usage

On Sun, 2008-10-12 at 13:17 -0500, Micah Gersten wrote:
> The problem with smarty is that they are still using PHP4 as their main
> language so they cannot take advantage of speed improvements in PHP5.
> So, my suggestion is that if you're stuck with PHP4, go with smarty,
> otherwise, find another engine that's up to date.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Nathan Rixham wrote:
> > Alain Roger wrote:
> >> Hi,
> >>
> >> i would like to know if you are a lot to use PHP templates for your web
> >> application or web sites ?
> >> if yes, which one do you use (smarty, pear, yapter, phplib,...) ?
> >> and for which reason ? what is/are the advantages over the others ?
> >>
> >> thanks a lot,
> >>

> >
> > I'd vote smarty or using xslt; smarty is very good and nine out of 10
> > designers I know prefer it.
> >

>

That's a fair point. I've never really gone into the whole template
thing myself, as I generally develop systems from scratch with a library
of components I've built up over time.


Ash
www.ashleysheridan.co.uk

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 20h03.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19823 seconds with 20 queries