From 29ea3a29642f5cec612f102683e6d43aba226148 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Tue, 4 Mar 2014 22:01:44 +0100 Subject: fixed some examples --- Examples/simple/simple.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Examples/simple') 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 x(&MyCustomClass::myMethod); - // define classes - extension.add("my_class", Php::Class({ - Php::Public("myMethod", Php::Method(&MyCustomClass::myMethod)), - Php::Public("__construct", Php::Method(&MyCustomClass::__construct)) - })); + Php::Class 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(); -- cgit v1.2.3