diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-06 19:32:12 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-06 19:32:12 +0100 |
commit | e4f90bd1d50405ab2e315041231553c9ea57b60f (patch) | |
tree | 3b2944626c558a0af02f69d08e4f0ad59367b9dc | |
parent | 218c0aa79103bf4d95b938371cc1df372ba15508 (diff) |
changes to documentation
-rw-r--r-- | documentation/classes-and-objects.html | 8 | ||||
-rw-r--r-- | documentation/constructors-and-destructors.html | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/documentation/classes-and-objects.html b/documentation/classes-and-objects.html index 16de480..21813bb 100644 --- a/documentation/classes-and-objects.html +++ b/documentation/classes-and-objects.html @@ -52,7 +52,7 @@ extern "C" { </p> <p> Let's talk about programming conventions first - we always use capitals for - the first letter of a classname, and our member variables always start with + the first letter of a classname, and member variables always start with an underscore. Every class always has a destructor, and it always is virtual. That's just a convention - our convention - and you do not have to follow that. @@ -64,7 +64,7 @@ extern "C" { </p> <p> If you want to make a class method that is accessible from PHP, you must - ensure that is has one of the eight supported signatures (which are the same + ensure that it has one of the eight supported signatures (which are the same signatures that <a href="functions">exportable plain functions</a> can have), plus their const variant. </p> @@ -88,7 +88,7 @@ Php::Value YourClass::example8(Php::Parameters &params) const; </p> <p> To make the class accessible from PHP, you must add it to the extension - object inside the get_module() function. The Php::Class template class can be + object inside the get_module() function. The Php::Class template class should be be used for that. The template parameter should be your implementation class, so that the Php::Class object internally knows which class to instantiate the moment the "new" operator is used inside a PHP script. @@ -199,7 +199,7 @@ echo($counter->value()."\n"); <p> In PHP (and in C++ too) you can mark methods as public, private or protected. To achieve this for your native class too, you should pass in an additional - flags parameter when you add the method to the Php::Class object. Image that + flags parameter when you add the method to the Php::Class object. Imagine that you want to make the increment and decrement methods in the previous example protected, then you can simply add a flag: </p> diff --git a/documentation/constructors-and-destructors.html b/documentation/constructors-and-destructors.html index 54ca23f..42a6699 100644 --- a/documentation/constructors-and-destructors.html +++ b/documentation/constructors-and-destructors.html @@ -106,7 +106,8 @@ $d = new DERIVED(); never confuse your C++ constructor with the __construct() method. In the C++ constructor, the C++ object is being constructed and the PHP object does not yet exist. After the constructor is finished, the PHP engine - will create the PHP object, and the __construct() method gets called. It is therefore + will create the PHP object, and the PHP-CPP library will link that PHP object + to your C++ class. And only then the __construct() method gets called. It is therefore valid to have both a C++ constructor and a __construct() method in your class. </p> <p> |