Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: mini-languages for MVC view/controller manipulation

by jdporter (Canon)
on Dec 27, 2004 at 14:55 UTC ( #417552=note: print w/ replies, xml ) Need Help??


in reply to mini-languages for MVC view/controller manipulation

I, for one, think your HTML::Seamstress module is very cool and elegant. (So what if the idea originated elsewhere.) But, a couple comments on the html compilation bit:

  1. In the line  $name->hello_world(name => $content); where does that hello_world method come from? Seems to me that you really want to be saying  $name->replace_with($content); (And you should probably then call  $name->delete_content(); first.)

  2. In your look_down call, don't you also want to include criteria to look for klass=content? I think that would be prudent.
metaperl++ (and all your other egos too, btw ;-)


Comment on Re: mini-languages for MVC view/controller manipulation
Select or Download Code
Re^2: mini-languages for MVC view/controller manipulation
by metaperl (Curate) on Dec 27, 2004 at 18:06 UTC
    I, for one, think your HTML::Seamstress module is very cool and elegant
    Thank you very much jdporter.

    In the line  $name->hello_world(name => $content); where does that hello_world method come from? Seems to me that you really want to be saying $name->replace_with($content); (And you should probably then call  $name->delete_content(); first.)
    You are right. I updated the code to what it actually was in the test suite. Actually the content_handler method does what you are talking about.

    There is a very nice extension of HTML::TreeBuilder by Matthew Sisk called HTML-Element-Extended. In both of our efforts, we have written a dozen or so convenience methods for common Treebuilder idioms. So, I am developing something called HTML::Element::Library which will have all of our methods in one place.

    In your look_down call, don't you also want to include criteria to look for klass=content? I think that would be prudent.
    Well, here I rely on the fact that an HTML document must have unique id tags... but your suggestion certainly wouldn't hurt and it would be more precise...

    Thanks for the comments.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://417552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-09-19 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (132 votes), past polls