SV: Choosing the right framework

C

Carsten Gehling

-----Oprindelig meddelelse-----
Fra: (e-mail address removed)
[mailto:p[email protected]]På vegne af David McNab
Sendt: 17. juli 2003 01:32
Til: (e-mail address removed)
Emne: Re: Choosing the right framework
I've been working on an HTML generation framework called 'pyWeb'. Just
posted to this ng yesterday, calling for testers.

You might like to visit http://www.freenet.org.nz/python/pyweb and have a
look.

This I did - to be honest, I'm no real fan of frameworks where you make
objects/functions to represent html-tags. It's IMHO not a good way to
seperate logic and presentation. I'm more to the kind of templates where you
write your own html snippets and embed som sort of template markers inside.

But thanks anyway. :)

I actually did this myself in PHP, but in a greater level of abstraction. I
needed a fast way of creating "user interfaces" (dialog forms etc.), so I
created a class hierarchy with tab-pages, layout managers, input controls,
etc. that all conformed to the general design.

The complete script for an dialog form to edit eg. an article would look
like this (mind you - it's PHP):
-------------------------------------
$dlg = new UI_TabDialog("Edit article");
$dlg->form_action = "artikel_update.php";
$dlg->add_hidden_field("id", $id);

$page = new UI_TabPage("Article");

$layout = new UI_Layout_row(array(
array(100),
array(100),
array(100),
array(50, 50),
array(100)
));

$c = new UI_Control_static("Edit your article and click on "Save");
$layout->add_control($c);

$c = new UI_Control_input("title", "Header", "");
$layout->add_control($c);

$c = new UI_Control_textarea("body", "Main article text", "", 190);
$layout->add_control($c);

$c = new UI_Control_date("releasedate", "Release the article on",
date("Y-m-d"));
$layout->add_control($c);

$c = new UI_Control_date("expiredate", "Expire the article on",
date("Y-m-d"));
$layout->add_control($c);

$c = new UI_Control_image("image_id", "Attach image to article", "");
$c->url_template = IMAGE_UPLOAD_PATH . "image_%d.jpg";
$layout->add_control($c);

$page->add_control($layout);

$dlg->add_page($page);

$dlg->draw();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top