(Yaf >=1.0.0)
Yaf_Registry::get — Retrieve an item from registry
Retrieves a value from the registry.
nameThe name of the registry entry.
The value stored under name, or null if there is no entry with that name.
Example #1 Yaf_Registry::get() example
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
$redis = Yaf_Registry::get("redis");
if ($redis === null) {
throw new Exception("the redis connection is not registered");
}
$this->getView()->assign("visits", $redis->get("site:visits"));
return true;
}
}
?>