<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-15"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Bojan Mihelac ha scritto:
<blockquote cite="mid:BFFF5C72-7970-489A-8013-9C17D97AE9EF@gmail.com"
 type="cite">
  <pre wrap="">On 20.2.2008, at 18:26, Earnie Boyd wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Quoting Bojan Mihelac <a class="moz-txt-link-rfc2396E" href="mailto:bmihelac@gmail.com">&lt;bmihelac@gmail.com&gt;</a>:

    </pre>
    <blockquote type="cite">
      <pre wrap="">Hi all,
does Drupal have some helper function for creating HTML tags, like it
exists in Rails (and I think cakePHP)?

somethin that could be called like this:

$output = tag("h1", $node-&gt;title, array('class' =&gt; ''title));

      </pre>
    </blockquote>
    <pre wrap="">You mean something like <a class="moz-txt-link-freetext" href="http://api.drupal.org/api/function/theme">http://api.drupal.org/api/function/theme</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->Earnie, thanks for your answer.

Well, I was looking for some easy way to create HTML code from custom  
module.
I would like to be able to call template file and send some variables  
to it for styling. Something like: $output =  
template("my_template_name", $vars_to_pass).  Is there function for  
this?
  </pre>
</blockquote>
Like this: <br>
<br>
function _mw_blog() {<br>
        //Prendo l'ultimo blog<br>
                //echo "وووووو";<br>
        //print_r("pippo");<br>
        $query = "select nid from {node} where type =
'blog_programmazione' and status = 1 and promote = 1 order by nid desc
limit 0,1";<br>
        $nid = db_result(db_query($query));<br>
        $node = node_load($nid);<br>
        //dvr($node);<br>
        $var = array();<br>
        $var['title'] = $node-&gt;title;<br>
        $var['body'] = $node-&gt;teaser;<br>
        $var['link'] = "/".$node-&gt;path;<br>
        $var['image'] = "/".$node-&gt;field_forum_img[0]['filepath'];<br>
        //dvr($var);<br>
        return _phptemplate_callback('blog-front',$var);<br>
}<br>
<br>
blog-front.tpl.php:<br>
<br>
&lt;div class="hpBox2"&gt;<br>
<br>
                                        &lt;H3&gt;Dal Blog&lt;/H3&gt;<br>
                                        &lt;div class="mid"&gt;<br>
                                                &lt;img src="&lt;?php
echo $image ?&gt;" width="90" height="65"/&gt;<br>
                                                &lt;p
class="titolinoBox"&gt;&lt;?php echo $title ?&gt;&lt;/p&gt;<br>
                                                &lt;p&gt;&lt;?php echo
$body ?&gt;&lt;/p&gt;<br>
                                                &lt;p
class="boxLink"&gt;&lt;a href="&lt;?php echo $link ?&gt;"&gt;Leggi
l'articolo&lt;/a&gt;&lt;/p&gt;<br>
                                        &lt;/div&gt;<br>
                                        &lt;div
class="fine"&gt;&lt;/div&gt;<br>
                                &lt;/div&gt;<br>
<br>
<br>
M.<br>
<pre class="moz-signature" cols="72">-- 
Michel 'ZioBudda' Morelli                       <a class="moz-txt-link-abbreviated" href="mailto:michel@ziobudda.net">michel@ziobudda.net</a>
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

<a class="moz-txt-link-freetext" href="http://www.ziobudda.net">http://www.ziobudda.net</a>                         ICQ: 58351764  
<a class="moz-txt-link-freetext" href="http://www.ziobuddalabs.it">http://www.ziobuddalabs.it</a>                      Skype: zio_budda
<a class="moz-txt-link-freetext" href="http://www.ajaxblog.it">http://www.ajaxblog.it</a>                                MSN: <a class="moz-txt-link-abbreviated" href="mailto:michel@ziobuddalabs.it">michel@ziobuddalabs.it</a>                   
                                                JABBER: <a class="moz-txt-link-abbreviated" href="mailto:michel@gmail.com">michel@gmail.com</a>
</pre>
</body>
</html>