<!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"><bmihelac@gmail.com></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->title, array('class' => ''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->title;<br>
$var['body'] = $node->teaser;<br>
$var['link'] = "/".$node->path;<br>
$var['image'] = "/".$node->field_forum_img[0]['filepath'];<br>
//dvr($var);<br>
return _phptemplate_callback('blog-front',$var);<br>
}<br>
<br>
blog-front.tpl.php:<br>
<br>
<div class="hpBox2"><br>
<br>
<H3>Dal Blog</H3><br>
<div class="mid"><br>
<img src="<?php
echo $image ?>" width="90" height="65"/><br>
<p
class="titolinoBox"><?php echo $title ?></p><br>
<p><?php echo
$body ?></p><br>
<p
class="boxLink"><a href="<?php echo $link ?>">Leggi
l'articolo</a></p><br>
</div><br>
<div
class="fine"></div><br>
</div><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>