0
我想添加一個靜態成員像下面如何在PHP類與PHP-CPP添加靜態數組
class BaseYii{
public static $map = [1,2,3]//sutff
}
這是我的C++代碼,
class BaseYii : public Php::Base {
public:
Php::Array hehe;
BaseYii() = default;
/**
* c++ destructor
*/
virtual ~BaseYii() = default;
void __construct() {
Php::Value self(this);
Php::Array x{123, "adf"};
self["fff"] = x;
}
void getServer() {
Php::call("var_dump", Php::SERVER);
}
};
寄存器擴展名,如何將Php :: Array或Php :: value設置爲此屬性
Php::Class<BaseYii> baseYii("BaseYii");
Php::Class<Yii> Yii("Yii");
static std::map<int, int> map;
map[1] = 1;
baseYii.property("classMap", "here ,i want to set a Array or Php::value", Php::Public | Php::Static);