News新闻

业界新闻动态、技术前沿
Who are we?

您的位置:首页      乐道系统FAQ      Zend Framework入门教程之Zend_Registry组件用法详解

Zend Framework入门教程之Zend_Registry组件用法详解

发布日期:2016-12-09 00:00:00 79

本文实例讲述了Zend Framework中Zend_Registry组件用法。分享给大家供大家参考,具体如下:

1.对象注册表

入门案例:

<?php
require_once("Zend/Loader.php");
Zend_Loader::loadClass('Zend_Registry');
$member = array(
  "姓名"=>"张三",
  "性别"=>"女",
  "年龄"=>"13",
  "职业"=>"学生",
  "爱好"=>"玩游戏",
  "血型"=>"AB"
  );
$registry = new Zend_Registry($member);
echo "姓名为:";
echo $registry["姓名"];
echo "<p>";
echo "性别为:";
echo $registry["性别"];
echo "<p>";
echo "年龄为:";
echo $registry["年龄"];
echo "<p>";
echo "职业为:";
echo $registry["职业"];
echo "<p>";
echo "爱好为:";
echo $registry["爱好"];
echo "<p>";