public static function getInstance() { if (!self::$instance) { self::$instance = new self(); } return self::$instance; }
<?php set_include_path(get_include_path() . PATH_SEPARATOR . dirname(dirname(dirname(__FILE__))) . "/Zigu/libs" . PATH_SEPARATOR . dirname(dirname(dirname(__FILE__))) . "/Zigu/src"); require_once 'Zigu/Service/PollServiceFactory.php'; $ziguService = PollServiceFactory::getInstance()->createPollService(); ?> <script language="javascript" type="text/javascript" src="http://image.dukuai.com/dukuai/js/jq/jquery-1.2.6m.js"></script> <style> <!-- /*全局CSS定义*/ body {font-family:Tahoma, Arial, sans-serif,"宋体";margin:0;padding:0;font-size:12px; color:#000;} div,form,img,ul,ol,li,dl,dt,dd {margin: 0; padding: 0; border: 0;} h1,h2,h3,h4,h5,h6 { margin:0; padding:0;} table,td,tr,th{font-size:12px;} a{text-decoration:none;color:#333;} a:hover{text-decoration:underline;color:#000;} /*新增投票投票*/ .pcontent{margin-left:20px;margin-top:10px;} .pcontent dl dt{list-style-type:none;font-size:18px;color:red} .pcontent dl dd{list-style-type:none;font-size:14px;} .pcontent ul li{list-style-type:none;font-size:14px;} --> </style> <div class="pcontent"> <form action="index.php" method="POST"> <div> <div> <dl> <dt>投票</dt>
public function getPollService() { require_once 'zigu/poll/service/PollServiceFactory.php'; return PollServiceFactory::getInstance()->createPollService(); }