1.

What is Dependency Injection in Slim Framework?

Answer»

In Slim FRAMEWORK, dependency injection is a container for preparing, managing, and injecting application DEPENDENCIES.

12. How to set and get a cookie in Slim Framework?

Setting a cookie in Slim Framework will REQUIRE a key, value, and specific time to allow the cookie to be present.

Example

// With all parameters

$app->setCookie(
   $name,
   $value,
   $expiresAt,
   $path,
   $DOMAIN,
   $SECURE,
   $httponly
);


// To set Cookie
$app->setCookie('bestinterviewquestion', 'bar', '2 days');

// To get Cookie
$app = new \Slim\Slim();
$foo = $app->getCookie('bestinterviewquestion');



Discussion

No Comment Found