Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将对象存储在 Zend_Registry 实例中,以便将对象的每个属性作为索引加载,并将对象属性的每个值存储为注册表的值?
回答了我自己的问题。创建一个扩展 Zend_Registry 的类并添加以下方法:
public static function loadObject($object){ $data = get_object_vars($object); foreach($data as $key => $value){ self::set($key, $value); } }