Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Argument 1 passed to Twig_Template::render() must be of the type array, object given #75

laacz opened this Issue · 3 comments

3 participants


I'm sorry to intrude like that, but would it be possible to merge no_static_view branch already? Just set up a new development workspace and got this error again. Twig from Extras is broken, when installing via Composer.

    "require": {
        "slim/slim": "2.*",
        "slim/extras": "2.*",
        "twig/twig": "1.*"

Error message is self-explanatory:

Slim Application Error
The application could not run because of the following error:


Type: ErrorException
Code: 4096
Message: Argument 1 passed to Twig_Template::render() must be of the type array, object given, called in /var/www/ on line 99 and defined
File: /var/www/
Line: 244

#0 /var/www/ Slim\Slim::handleErrors(4096, 'Argument 1 pass...', '/var/www/tld....', 244, Array)
#1 /var/www/ Twig_Template->render(Object(Slim\Helper\Set))
#2 /var/www/ Slim\Extras\Views\Twig->render('index.twig')
#3 /var/www/ Slim\View->fetch('index.twig')
#4 /var/www/ Slim\View->display('index.twig')
#5 /var/www/ Slim\Slim->render('index.twig')
#6 [internal function]: {closure}()
#7 /var/www/ call_user_func_array(Object(Closure), Array)
#8 /var/www/ Slim\Route->dispatch()
#9 /var/www/ Slim\Slim->call()
#10 /var/www/ Slim\Middleware\Flash->call()
#11 /var/www/ Slim\Middleware\MethodOverride->call()
#12 /var/www/ Slim\Middleware\PrettyExceptions->call()
#13 /var/www/ Slim\Slim->run()
#14 {main}vvvvw```

My application also had problem when I used the composer command update
having to use the versions below to have no problem.

"require": {
"php": "> = 5.3.0"
"slim / slim": "2",
"slim / extras": "2",
"twig / twig": "1. "
"illuminate / database": "
"dhorrigan / capsule": "*"


Pleas use slim/views instead. Btw you no longer need dhorrigan/capsule to use DB schema outside of Laravel, that package has been included since 4.0.4 I think.


You're right, no longer need the package dhorrigan/capsule Thank You.

@PEKTOP PEKTOP referenced this issue from a commit
@PEKTOP PEKTOP fix Issue #75
namespace Slim;
class View
     * Return view data
     * @return array
    public function all()
        return $this->data->all();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.