看不懂,你哪里生出个$screen->setServlet($action);你这样设计类不好吧?
解决方案 »
- 这个网站采集不了,大家帮忙给点意见
- 关于Ocilogon函数链接Oracle9i的问题,很有难度,达人来接受挑战!!!
- 麻烦哪位 学哥学姐有时间帮我看看
- PHP新手 关于PHP中setcookie问题和move_uploaded_file问题
- 大家看看的login.php存在漏洞吗?
- php 发出http请求
- 写入文本中时出错的问题!
- mysql_connect("localhost", "root", "root")中的密码,可否不写明文,改成加密方式?
- 如何用php实现倒计时功能,并将时间在网页上显示出来?
- php有没有这个能力:获取某个文件的类型。有哪位知道。甘愿送分。
- 升星了!~~~~~~
- apache + ssl + php 完全安装需要多少空间 ?
是__construct,两横的~~
class Action{
function doAction(){
print("test");
}
}
class Temp{
private $action;
private $html;
public function _construct(){
}
function getAction(){
return $this->$action;
}
function getHtml(){
return $this->$html;
} function setAction($_action){
$this->$action = $_action;
}
function setHtml($_html){
$this->$html = $_html;
}
}class Config{ function getName($name){
$Temp = new Temp();
$action = new Action();
$html = 2;
$screen->setAction($action);
$screen->setTemplate($html);
return $temp;
}
}
class A{
function execute(){
$config = new Config();
$aa = "random";
$tt = $config->getName($aa);
print($tt->getAction());
}
}
function __construct()
$screen在哪里实例化的?
class Config{ function getName($name){
$Temp = new Temp();
$action = new Action();
$html = 2;
$Temp->setAction($action);
$Temp->setTemplate($html);
return $temp;
}
}
class Config{ function getName($name){
$Temp = new Temp();
$action = new Action();
$html = 2;
$Temp->setAction($action);
$Temp->setHtml($html);
return $temp;
}
}
Thanks all guys. Thank you for your paying attention to this.to surfchen(冲浪) :
OOD is a solutions and methods set to help we to build a system. Every languages has its spec to implements those. In this issue, it's a solecism that I made. In the case of I write a new class to replace it, It will still not work. But thanks you all same.
The variable is named $cart->items, not $cart->$items, that is, a variable name in PHP has only a single dollar sign. <?php
// correct, single $
$cart->items = array("10" => 1); // invalid, because $cart->$items becomes $cart->""
$cart->$items = array("10" => 1);// correct, but may or may not be what was intended:
// $cart->$myvar becomes $cart->items
$myvar = 'items';
$cart->$myvar = array("10" => 1);
?>
class Cart {
var $todays_date;
var $name;
var $owner;
var $items = array("VCR", "TV"); function Cart() {
$this->todays_date = date("Y-m-d");
$this->name = $GLOBALS['firstname'];
/* etc. . . */
}
}