Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-04 Thread Paul Scott

On Tue, 2006-07-04 at 18:54 -0300, Manuel Lemos wrote:

> The truth is that good PHP developers are often not good Web (page)
> designers, and good Web designers are not good developers.

Yes, I agree with this completely! I am a relatively decent developer,
but ask me to design an interface and you make a blabbering idiot of
me... 

In our framework, Chisimba (Framework in a bunch of African languages),
we completely separate the logic components from the templates and view
(MVC). The nice thing about working in this way is that all of our code
is modular as well as OO, so that if I write an object it can be
re-used, as well as form only a small part of a module. This means that
it is possible to get multiple developers and designers all working
simultaneously on a single module to get it done really quickly.

Also, to take your original topic a little further, we not only abstract
database calls, but also everything else. For example, in an e-learning
context we call our Content system a course, in a CMS implementation a
Content Area, and in a groupware implementation a Work Area. This in
multiple languages makes for a highly configurable set up! Keep all of
that in mind when designing your app, as it caters for the widest
possible audience, as well as the project contributing significantly to
other projects. (Our project has contributed around 15 or so classes to
phpclasses.org, bugfixes and feature requests to a couple of pear
projects, amongst others).

--Paul

All Email originating from UWC is covered by disclaimer  
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-04 Thread Manuel Lemos
Hello,

on 07/03/2006 05:22 PM Jay Paulson said the following:
 I'd like to get some feedback on what the list thinks is a good template
 engine other than smarty.

 I'd also like to do some quick prototyping using a PHP framework does 
 anyone
 have any recommendations for one that is easy to pick up and run with?

 Finally, does anyone have any suggestions for a good PHP database
 abstraction library?
>>> You may want to take a look at this post for a few recommendations:
>>>
>>> http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html
>> That is a nice sales pitch Manuel but takes  bit of digesting.
>>
>> Jay - This is a 'how long is a piece of string' type question. So there
>> are as many answers as there are developers here ;)
>>
>> I've only ever used Smarty - and not seen anything yet to replace it.
>>
>> PDO is being pushed as a DB Abstraction library, but it only 'abstracts'
>> the calls to PHP, it does nothing to abstract the SQL if you want a
>> truly generic solution, if you need one, but if you don't then why
>> bother with abstraction ;)
> 
> Thinking about this paragraph above makes me wonder if with that way of
> looking at it would one need a template engine?  For example, why not just
> separate the business logic and the HTML as much as possible and then only
> imbed PHP in HTML to display the variables ()?? Then at the end
> of your PHP code that does all the logic just have include() calls to the
> .php files you want to parse and pass all the variables you got with your
> business logic above the include calls? Hm.  Just a thought.

You think like that because you work alone or with other PHP developers.

The truth is that good PHP developers are often not good Web (page)
designers, and good Web designers are not good developers.

Therefore it makes sense to split the Web page design work from PHP
programming work.

Smarty templates are easier to learn by Web designers than PHP. They do
not need to know PHP.

Furthermore, it is not a good idea to leave Web designers that does not
know PHP very well to write PHP code as they may write insecure code and
you will have to double the work by auditing the  PHP based templates.


-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-04 Thread Manuel Lemos
Hello,

on 07/03/2006 03:38 AM Lester Caine said the following:
>>> I'd like to get some feedback on what the list thinks is a good template
>>> engine other than smarty.
>>>
>>> I'd also like to do some quick prototyping using a PHP framework does
>>> anyone
>>> have any recommendations for one that is easy to pick up and run with?
>>>
>>> Finally, does anyone have any suggestions for a good PHP database
>>> abstraction library?
>>
>> You may want to take a look at this post for a few recommendations:
>>
>> http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html
> 
> That is a nice sales pitch Manuel but takes  bit of digesting.

If you were looking for specific recommendations, they are at the end of
the post.

Anyway, the post was more to say that there is no consense regarding
what is the recommended framework for PHP. Most people end up picking
components for different purposes from different sources because
different developers have developed the best packages for their own
purposes.

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Lester Caine

Jay Paulson wrote:


Thinking about this paragraph above makes me wonder if with that way of
looking at it would one need a template engine?  For example, why not just
separate the business logic and the HTML as much as possible and then only
imbed PHP in HTML to display the variables ()?? Then at the end
of your PHP code that does all the logic just have include() calls to the
.php files you want to parse and pass all the variables you got with your
business logic above the include calls? Hm.  Just a thought.


When I look at the complexity of the installer and the user management 
system in bitweaver, then the answer is probably yes. But then I look at 
the code that provides the mapserver client and I'm glad that the rest 
of the 'variables' are taken care of :)


--
Lester Caine - G8HFL
-
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop - 
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/

Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Jay Paulson
>>> I'd like to get some feedback on what the list thinks is a good template
>>> engine other than smarty.
>>> 
>>> I'd also like to do some quick prototyping using a PHP framework does anyone
>>> have any recommendations for one that is easy to pick up and run with?
>>> 
>>> Finally, does anyone have any suggestions for a good PHP database
>>> abstraction library?
>> 
>> You may want to take a look at this post for a few recommendations:
>> 
>> http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html
> 
> That is a nice sales pitch Manuel but takes  bit of digesting.
> 
> Jay - This is a 'how long is a piece of string' type question. So there
> are as many answers as there are developers here ;)
> 
> I've only ever used Smarty - and not seen anything yet to replace it.
> 
> PDO is being pushed as a DB Abstraction library, but it only 'abstracts'
> the calls to PHP, it does nothing to abstract the SQL if you want a
> truly generic solution, if you need one, but if you don't then why
> bother with abstraction ;)

Thinking about this paragraph above makes me wonder if with that way of
looking at it would one need a template engine?  For example, why not just
separate the business logic and the HTML as much as possible and then only
imbed PHP in HTML to display the variables ()?? Then at the end
of your PHP code that does all the logic just have include() calls to the
.php files you want to parse and pass all the variables you got with your
business logic above the include calls? Hm.  Just a thought.
 
> I've been running with bitweaver now for some time, and things are
> starting to come together. It uses Smarty and ADOdb and can install
> itself on a range of database engines without any 'manual intervention'.
> So I am happy that it is a generic framework that is easy to run with.
> 
> www.bitweaver.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Jens Kleikamp

Robert Cummings wrote:

On Mon, 2006-07-03 at 08:37, Jens Kleikamp wrote:

Jay Paulson wrote:

I'd like to get some feedback on what the list thinks is a good template
engine other than smarty.


I like ezTemplate. (E_STRICT)


YOU DO?? I hope it's changed then from the one used on a site I'm now
maintaining. I find it to be a nightmare. You can't just move around
blocks of content because the template's block structure requires you
maintain the nesting association... thus you need to go back to the code
every time you move a block of content to synch up the block
declarations.

Cheers,
Rob.

Hi Rob,

Sorry, typo, I meant ezcTemplate. Maybe ezTemplate is a package within 
ezPublish 3.x cms, which I don´t know. ( not 100% sure )


The lately released ezcTemplate does the job very well, I didn´t 
experienced the issue you described.


Cheers,
Jens

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Robert Cummings
On Mon, 2006-07-03 at 08:37, Jens Kleikamp wrote:
> Jay Paulson wrote:
> > I'd like to get some feedback on what the list thinks is a good template
> > engine other than smarty.
> > 
> 
> I like ezTemplate. (E_STRICT)

YOU DO?? I hope it's changed then from the one used on a site I'm now
maintaining. I find it to be a nightmare. You can't just move around
blocks of content because the template's block structure requires you
maintain the nesting association... thus you need to go back to the code
every time you move a block of content to synch up the block
declarations.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Jens Kleikamp

Jay Paulson wrote:

I'd like to get some feedback on what the list thinks is a good template
engine other than smarty.



I like ezTemplate. (E_STRICT)


I'd also like to do some quick prototyping using a PHP framework does anyone
have any recommendations for one that is easy to pick up and run with?



Seems to be a really difficult question imho :)


Finally, does anyone have any suggestions for a good PHP database
abstraction library?



Depends on your environment, MDB2 is fine if you have to run php4, 
otherwise, I like Zend_Db 
(http://framework.zend.com/manual/en/zend.db.html)
and also ezDatabase 
(http://ez.no/doc/components/view/latest/(file)/classtrees_Database.html)

is worth a look.

just my 0,2 €cents

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Lester Caine

Kevin Waterson wrote:


This one time, at band camp, Lester Caine <[EMAIL PROTECTED]> wrote:

PDO is being pushed as a DB Abstraction library, but it only 'abstracts' 
the calls to PHP, it does nothing to abstract the SQL if you want a 
truly generic solution, if you need one, but if you don't then why 
bother with abstraction ;)


Whoa dragon 


PDO is not being pushed as a DB Abstraction library. From the manual..


Both other replies to this thread quoted PDO without mentioning that it 
not a DB Abstraction library - because the misconception is that PDO is. 
So I was just correcting those messages.


--
Lester Caine - G8HFL
-
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop - 
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/

Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-03 Thread Kevin Waterson
This one time, at band camp, Lester Caine <[EMAIL PROTECTED]> wrote:

 
> PDO is being pushed as a DB Abstraction library, but it only 'abstracts' 
> the calls to PHP, it does nothing to abstract the SQL if you want a 
> truly generic solution, if you need one, but if you don't then why 
> bother with abstraction ;)

Whoa dragon 

PDO is not being pushed as a DB Abstraction library. From the manual..
"PDO provides a data-access abstraction layer, which means that,
regardless of which database you're using, you use the same functions to
issue queries and fetch data. PDO does not provide a database abstraction;
it doesn't rewrite SQL or emulate missing features. 
You should use a full-blown abstraction layer if you need that facility."

As you see, PDO provides a standard interface to databases, you might use
PDO to create an abstraction layer, but is not an abstraction layer in itself.

Kind regards
Kevin

-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-02 Thread Lester Caine

Manuel Lemos wrote:


on 06/30/2006 11:38 AM Jay Paulson said the following:


I'd like to get some feedback on what the list thinks is a good template
engine other than smarty.

I'd also like to do some quick prototyping using a PHP framework does anyone
have any recommendations for one that is easy to pick up and run with?

Finally, does anyone have any suggestions for a good PHP database
abstraction library?


You may want to take a look at this post for a few recommendations:

http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html


That is a nice sales pitch Manuel but takes  bit of digesting.

Jay - This is a 'how long is a piece of string' type question. So there 
are as many answers as there are developers here ;)


I've only ever used Smarty - and not seen anything yet to replace it.

PDO is being pushed as a DB Abstraction library, but it only 'abstracts' 
the calls to PHP, it does nothing to abstract the SQL if you want a 
truly generic solution, if you need one, but if you don't then why 
bother with abstraction ;)


I've been running with bitweaver now for some time, and things are 
starting to come together. It uses Smarty and ADOdb and can install 
itself on a range of database engines without any 'manual intervention'. 
So I am happy that it is a generic framework that is easy to run with.


www.bitweaver.org

--
Lester Caine - G8HFL
-
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop - 
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/

Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates, PHP Frameworks, and DB Abstraction?

2006-07-02 Thread Manuel Lemos
Hello,

on 06/30/2006 11:38 AM Jay Paulson said the following:
> I'd like to get some feedback on what the list thinks is a good template
> engine other than smarty.
> 
> I'd also like to do some quick prototyping using a PHP framework does anyone
> have any recommendations for one that is easy to pick up and run with?
> 
> Finally, does anyone have any suggestions for a good PHP database
> abstraction library?

You may want to take a look at this post for a few recommendations:

http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html

-- 

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Templates Are Driving me Nuts

2004-07-17 Thread Sean Malloy
The template system I use is extremely simple.

Template.php:
Items = array();
$this->_document = $document;
}

function Render()
{
echo $this->ToString();
}

function ToString()
{
$template = $this->Items;
ob_start();
require($this->_document);
return ob_get_clean();
}
}
?>

and to use it?

templates/index.html:



Hello , it is currently 



index.php:
Items['name'] = 'User';
$template->Items['time'] = date('d M Y', time());
$template->Render();
?>

why use it?

Because you keep your html and your php code separate. That is the
goal when using any templating system.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates Are Driving me Nuts

2004-07-17 Thread Skrol 29
Hello,

Here is a shema to explain Template Engines:
  http://www.tinybutstrong.com/index.php?page=template

Some developers complain about Template Engines because they are too complex
or because they are a kind of new language over PHP. The one you will found
on the URL above is expected to be different.

---
Skrol 29
www.skrol29.com
www.tinybutstrong.com
---
"Ee" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Dears,
>
> Please help. This template thing is driving my nuts. I though maybe when
> I read more articles things will clear up; however, things got even
> worse. Every article writer has a different idea. Can anyone explain to
> me what are Templates for? What are the advantages of using them? If I
> use a third party template, will my site have a different look or is it
> only a parser that will take my designed template and data and combine
> them. I really don't know.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates/Separate content from presentation

2003-11-01 Thread rush
"Pedro Pais" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've coded in PHP for a while, but I had to leave it for some time. Now
> I'm back, and I'd like to know what's currently being used to separate
> content from presentation, besides Smarty (that seems to be Google's top
> choice)?

Try also TemplateTamer, it comes with dev environment for tempalte based
development.

rush
--
http://www.templatetamer.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates/Separate content from presentation

2003-10-31 Thread Greg Beaver
Hi Pedro,

try http://www.phpsavant.com

Regards,
Greg
Pedro Pais wrote:

Hi!

I've coded in PHP for a while, but I had to leave it for some time. Now 
I'm back, and I'd like to know what's currently being used to separate 
content from presentation, besides Smarty (that seems to be Google's top 
choice)?

Thanx
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Templates...

2003-07-15 Thread Pete Morganic
Have u looked at smarty.php.net ??

It sounds like your reinventing the wheel

Pete

Donatas wrote:
Does anyone know any other way used in template engines for loops but
creating array first and passing it to template class?
This is rather annoying and it makes work slower and code harder to read.

 

I've made my own template class with variable and loop support. Loop
handling is way different from what I've seen in other template engines.
I've made few screenshots of code examples (I was too lazy to add font
colors). Please let me know if you've seen this idea before, and what you
think of it. The class still needs some tweaking but I'll post it here some
other day if anyone is interested.
 

Cheers,

Donny




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] RE: Templates... (dumb me)

2003-07-14 Thread Donatas
http://www.mif.vu.lt/~doma2988/tpl/


From: Donatas [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 14, 2003 7:38 PM
To: '[EMAIL PROTECTED]'

Does anyone know any other way used in template engines for loops but
creating array first and passing it to template class?
This is rather annoying and it makes work slower and code harder to read.

I've made my own template class with variable and loop support. Loop
handling is way different from what I've seen in other template engines.
I've made few screenshots of code examples (I was too lazy to add font
colors). Please let me know if you've seen this idea before, and what you
think of it. The class still needs some tweaking but I'll post it here some
other day if anyone is interested.


Cheers,
Donny


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Templates

2003-02-14 Thread rush
"Darren Young" <[EMAIL PROTECTED]> wrote in message
000e01c2d3b3$a88217e0$[EMAIL PROTECTED]">news:000e01c2d3b3$a88217e0$[EMAIL PROTECTED]...
>
> I'm looking around for some options on using templates with PHP. I've
> used several Perl solutions in the past, but never tried it in PHP.
> Digging on the web yields several options so I'd love some thoughts or
> comments. The real driver is that the basic site design could change
> over time and I'd like to have the basic HTML in the templates, and the
> real logic in the PHP code.

Hi,

take a look at the TemplateTamer (link is in the sig). Aside from beeing
just template engine, it commes with complete environment that eases many
chores while programming with templates. It is very easy to see the
structure of your templates, and to use them. Also TT offers very strong
separation of templates and logic, and does not suffer from code creeping
back into the templates.

rush
--
http://www.templatetamer.com/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: Templates: how to get that HTML outta my templates!

2002-01-23 Thread Mikusch, Rita


> * and then Mikusch, Rita blurted
> > Thank you for the reply. I'm trying to "roll my own" template system,
but
> > don't really know how to go about some of the details. My best bet would
> > probably be to install phplib and dissect itsee how the experts did
it!
> > At the very least it should be a great learning experience :)

> Rita, Rita, Rita...:=)
> "roll your own" Why? What possible reason could there be? (other than to
> learn how)

Well, yes I guess I would REALLY like to know more about setting up a large
project like this, set up a DB abstration layer, etc etc. 

I'll spend some time dissecting PHPLIB, writing a lot of code, hopefully
successfully debugging a lot of code . . . 

. . . then when I finally have time at work to move the website over to a
real template system with the PHP separated from the html and the design,
I'll be able to

a) implement PHPLIB template system for the whole site very easily since
I'll know enough about it to make whatever hacks are needed to adapt it to
our website's needs. I've checkout out reviews on the net and haunted the
mailing lists and this seems to be most people's favourite for PHP.

b) and I'll have learned some new programming skills that I'll be able to
adapt to other projects.

The XML/XSL solution also sounds really interesting, but my company has a
very small web department (one full time person -- me, the geek) and I'd
like to keep the number of technologies they need to support to a minimum. 

> You don't need to 'install' PHPLib, just get the template.inc file and
> include() it in your scripts. There are some good turorials listed on
> those articles I pointed out and it's s easy.
> Mail me offlist if you need more details.

Thanks! Rita.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Templates???

2001-08-15 Thread Richard Lynch

PHPLib, Smarty, FastTemplates, and about 10,000 more...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Georgie <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 7:05 PM
Subject: Templates???


> Can anyone direct me to some sample PHP code that extracts HTML from a
> template file and replaces the, say, "%field%" tags in the HTML with
> variables from the PHP file.
>
> Just like what Gossamer Threads Links program does with Perl. So, any 1
have
> any links??
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]