diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-04 22:01:44 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-04 22:01:44 +0100 |
commit | 29ea3a29642f5cec612f102683e6d43aba226148 (patch) | |
tree | ae9e268f5db60c79ee9f00c0294ca6865beb60ac /Examples/simple | |
parent | 5aaeb88d8b753a3b51e81c36dba6293dd436148b (diff) |
fixed some examples
Diffstat (limited to 'Examples/simple')
-rw-r--r-- | Examples/simple/simple.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Examples/simple/simple.cpp b/Examples/simple/simple.cpp index 3a93bdc..bfbcfab 100644 --- a/Examples/simple/simple.cpp +++ b/Examples/simple/simple.cpp @@ -161,21 +161,21 @@ extern "C" // define the functions extension.add("my_plus", my_plus, { - Php::ByVal("a", Php::numericType), - Php::ByVal("b", Php::numericType), + Php::ByVal("a", Php::Type::Numeric), + Php::ByVal("b", Php::Type::Numeric), Php::ByVal("c", "MyClass"), - Php::ByRef("d", Php::stringType) + Php::ByRef("d", Php::Type::String) }); extension.add("bubblesort", bubblesort); - Php::Method<MyCustomClass> x(&MyCustomClass::myMethod); - // define classes - extension.add("my_class", Php::Class<MyCustomClass>({ - Php::Public("myMethod", Php::Method<MyCustomClass>(&MyCustomClass::myMethod)), - Php::Public("__construct", Php::Method<MyCustomClass>(&MyCustomClass::__construct)) - })); + Php::Class<MyCustomClass> myCustomClass("my_class"); + myCustomClass.method("mymethod", &MyCustomClass::myMethod); + myCustomClass.method("__construct", &MyCustomClass::__construct); + + // add to extension + extension.add(myCustomClass); // return the module entry return extension.module(); |