The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

setdata using booleans gets undefined index

Sid's Avatar

Sid

26 Aug, 2015 04:27 AM

Can anyone help?

// This works....
$app->get('/', function() use ($app) {
  $app->render('home.php', array('logged' => true));
}

// This results in a 'index undefined' error when I try to use $this->data['logged'] in the view
$app->get('/', function() use ($app) {
  $app->render('home.php', array('logged' => false));
}

  1. 1 Posted by Sid on 28 Aug, 2015 04:35 AM

    Sid's Avatar

    Nevermind, the issue was unrelated to what I wrote above... passing false works perfectly fine.

    S

  2. Sid closed this discussion on 28 Aug, 2015 04:35 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac