Aaron J.Mackey wrote:


All I want to do with DBIx::Declare is provide a mechanism to separate the SQL into a separate file than the templates, so that the template designer only has to write:


<html>
<p>Hello <b>#person.name#</b>
</html>

And the (now reusable) SQL as:

name: person_name_by_id
provides: person.name
requires: person_id
sql: >
  SELECT name FROM person WHERE person_id = ?

And have some DBIx::Declare-aware template-processing engine handle page requests automagically such that adding new templates and/or SQL code doesn't involve writing or maintaining a single line of Perl code.
</digression>


you seem very HTML::Template oriented. do you plan for this solution to work with Template Toolkit?

Kake Pugh (I believe) wrote an article for Perl.com that showed how well Class::DBI and Template toolkit work almost automagically in this fashion. Class::DBI classes can have custom SQL and classes can automatically be created via Class::DBI::loader. Here is the URL:

http://www.perl.com/pub/a/2003/07/15/nocode.html

The article was called "How to Avoid Writing Code"







Reply via email to