Rework of blog example to be compliant with version of domframework

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1551 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-07-25 12:40:19 +00:00
parent 11624f512b
commit 92fbf288f7
5 changed files with 157 additions and 22 deletions

View File

@@ -8,14 +8,17 @@ class view_blog
{
/** Return the datas
@param array $data The list of titles */
function get ($data)
public function get ($data, $variable)
{
return $data;
$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 */
function listing ($data)
public function listing ($data, $variable)
{
$content = "<ul>\n";
foreach ($data as $val)
@@ -27,4 +30,10 @@ class view_blog
$content .= "</ul>\n";
return $content;
}
/** Create/Edit a blog */
public function edit ($data, $variable)
{
return $data;
}
}