Beispiel #1
0
        $controller->index();
        break;
    case 'show':
        $controller->show($id);
        break;
    case 'add':
        $controller->add();
        break;
    case 'create':
        $controller->create($post['title'], $post['body']);
        break;
    case 'edit':
        $controller->edit($id);
        break;
    case 'update':
        $controller->update($id, $post['title'], $post['body']);
        break;
    case 'delete':
        $controller->delete($id);
        break;
    default:
        break;
}
class BlogsController
{
    //プロパティ
    private $action = '';
    private $resource = '';
    private $viewOptions = '';
    private $id = '';
    private $title = '';
Beispiel #2
0
        $controller->index();
        break;
    case 'show':
        $controller->show($id);
        break;
    case 'add':
        $controller->add();
        break;
    case 'create':
        $controller->create($post);
        break;
    case 'edit':
        $controller->edit($id);
        break;
    case 'update':
        $controller->update($id, $post);
        break;
    case 'delete':
        $controller->delete($id);
        break;
    default:
        # code...
        break;
}
class BlogsController
{
    // プロパティ
    private $action = '';
    private $resource = '';
    private $viewOptions = '';
    public function index()