Location: PHPKode > projects > Atomik framework > atomik-3.0.0/example/app/actions/add.post.php
<?php

$fields = array(
    'title' => array('required' => true),
    'content' => array('required' => true)
);

if (($data = $this->filter($_POST, $fields)) === false) {
    $this->flash($this['app.filters.messages'], 'error');
    return;
}

$this['db']->insert('posts', $data);

$this->flash('Post successfully added!', 'success');
$this->redirect('index');
Return current item: Atomik framework