Created
October 6, 2011 09:55
-
-
Save makeusabrew/1267007 to your computer and use it in GitHub Desktop.
Jaoss - add article form controller / view refactoring
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* apps/news/controllers/news.php */ | |
class NewsController extends Controller { | |
public function add_article() { | |
// pass the columns array through to smarty | |
$this->assign("columns", Table::factory('Articles')->getColumns()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{* apps/news/views/add_article *} | |
<h1>Add an article</h1> | |
<p>Your story will be automatically published - so keep it clean!</p> | |
<form action="/articles/add" method="post"> | |
{include file='default/views/helpers/field.tpl' field='title'} | |
{include file='default/views/helpers/field.tpl' field='intro'} | |
{include file='default/views/helpers/field.tpl' field='content'} | |
{include file='default/views/helpers/field.tpl' field='author_email'} | |
<input type="submit" value="Add Article" /> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment