News新闻

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

您的位置:首页      网络营销      Zend Framework入门教程之Zend_Registry组件用法详解

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

本文实例讲述了Zend Framework中Zend_Registry组件用法。分享给大家供大家参考,具体如下:1.对象注册表入门案例:?phprequire_once("Zend/Loader.php");Zend_Loader::loadClass('Zend_Registry');$member = array("姓名"="张三","性别"="女","年龄"="13","职业"="

本文实例讲述了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>";

    我要评论
    共有 人参与,评论 条,顶帖 [点击查看]
  • 验证码:
  • 所有评论仅代表网友意见,与本站立场无关!