Files
DomFramework/examples/blog/views/view_blog.php

40 lines
964 B
PHP

<?php
/** DomFramework Blog
@package domframework-blog
@author Dominique Fournier <dominique@fournier38.fr> */
/** Display the articles of the blog */
class view_blog
{
/** Return the datas
@param array $data The list of titles */
public function get ($data, $variable)
{
$res = "<a href='".$variable["articleid"]."/edit'>Edit</a><br/>";
$res.= "<h1>".$variable["title"]."</h1>\n";
$res.= "<p>".$variable["content"]."</p>\n";
return $res;
}
/** Display the list of titles
@param array $data The list of titles */
public function listing ($data, $variable)
{
$content = "<ul>\n";
foreach ($data as $val)
{
$content .= " <li>";
$content .= "<a href='".urlencode ($val)."'>".htmlentities ($val)."</a>";
$content .= "</li>\n";
}
$content .= "</ul>\n";
return $content;
}
/** Create/Edit a blog */
public function edit ($data, $variable)
{
return $data;
}
}