Skip to content

problems with slim 2.6 - error template 200 not found #21

@vollyimnetz

Description

@vollyimnetz

Hi,
i can't get the examples to work in slim 2.6. I used the "routing example". It seems the View is not set correctly. Slim throws an Exception .

Message: View cannot render `200` because the template does not exist
File: <<path>>\vendor\slim\slim\Slim\View.php

Can you confirm that it work with slim 2.6?

My Code:

function APIrequest(){
    $app = \Slim\Slim::getInstance();
    $app->config('debug', false);
    $app->view(new \JsonApiView());
    $app->add(new \JsonApiMiddleware());
}

$app->get('/api','APIrequest',function() use($app){
    $app->render(200,array(
            'msg' => 'welcome to my API!',
        ));
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions