Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Open
laacz opened this Issue · 3 comments

3 participants

@laacz

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:

Details

Type: ErrorException
Code: 4096
Message: Argument 1 passed to Twig_Template::render() must be of the type array, object given, called in /var/www/tld.in/vendor/slim/extras/Slim/Extras/Views/Twig.php on line 99 and defined
File: /var/www/tld.in/vendor/twig/twig/lib/Twig/Template.php
Line: 244
Trace

#0 /var/www/tld.in/vendor/twig/twig/lib/Twig/Template.php(244): Slim\Slim::handleErrors(4096, 'Argument 1 pass...', '/var/www/tld....', 244, Array)
#1 /var/www/tld.in/vendor/slim/extras/Slim/Extras/Views/Twig.php(99): Twig_Template->render(Object(Slim\Helper\Set))
#2 /var/www/tld.in/vendor/slim/slim/Slim/View.php(237): Slim\Extras\Views\Twig->render('index.twig')
#3 /var/www/tld.in/vendor/slim/slim/Slim/View.php(227): Slim\View->fetch('index.twig')
#4 /var/www/tld.in/vendor/slim/slim/Slim/Slim.php(734): Slim\View->display('index.twig')
#5 /var/www/tld.in/index.php(13): Slim\Slim->render('index.twig')
#6 [internal function]: {closure}()
#7 /var/www/tld.in/vendor/slim/slim/Slim/Route.php(436): call_user_func_array(Object(Closure), Array)
#8 /var/www/tld.in/vendor/slim/slim/Slim/Slim.php(1291): Slim\Route->dispatch()
#9 /var/www/tld.in/vendor/slim/slim/Slim/Middleware/Flash.php(85): Slim\Slim->call()
#10 /var/www/tld.in/vendor/slim/slim/Slim/Middleware/MethodOverride.php(92): Slim\Middleware\Flash->call()
#11 /var/www/tld.in/vendor/slim/slim/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#12 /var/www/tld.in/vendor/slim/slim/Slim/Slim.php(1240): Slim\Middleware\PrettyExceptions->call()
#13 /var/www/tld.in/index.php(16): Slim\Slim->run()
#14 {main}vvvvw```
@gilsonbguedes

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": "*"
}

@silentworks
Collaborator

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.

@gilsonbguedes

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();
    }
...
}
e1b2d38
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.