From bb0a1d1a861a71c91de417a4c53ceefd9d5afcb3 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Fri, 14 Mar 2014 14:01:18 +0100 Subject: documentation typos --- documentation/properties.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'documentation') diff --git a/documentation/properties.html b/documentation/properties.html index 30368cc..50b0df3 100644 --- a/documentation/properties.html +++ b/documentation/properties.html @@ -12,11 +12,11 @@ It is difficult to imagine that someone in the world would like to create a native class, with regular non-typed public PHP properties on it. However, if you insist, you can use the PHP-CPP library for this. Let's take an example - class in PHP, and see what it will look like in C++. + class in PHP, and see what it would look like in C++.


-<?php
+<?php
 /**
  *  PHP example class
  */
@@ -57,7 +57,7 @@ $example->property1 = "new value";
 

The above example creates a class with one public property. This property - can be accessed by the Example class, but because it is public, also by + can be accessed by the Example class, and because it is public also by everyone else, as is shown in the example. If you like such classes, you can write something similar with PHP-CPP.

@@ -140,7 +140,7 @@ extern "C" {

- The example code shows how you need to initialize the properties inside + The example code shows how you initialize the properties inside the get_module() function.

@@ -151,14 +151,14 @@ extern "C" {

Smart properties

With the magic methods __get() and __set() you - can make more advanced properties that are directly mapped to your C++ - code, and that allows you to perform additional checks when a property + can make more advanced properties that are directly mapped to C++ + variables, and that allow you to perform additional checks when a property is overwritten, so that an object always remains in a valid state.

On top of that, with the PHP-CPP library you can also assign getter and setter methods to properties. Every time a property is accessed, your getter - or setter method will automatically be accessed. + or setter method will automatically be called.


@@ -171,7 +171,7 @@ class Example : public Php::Base
 {
 private:
     /**
-     *  Example property 1
+     *  Example property
      *  @var    int
      */
     int _value = 0;
@@ -258,7 +258,7 @@ extern "C" {
 


-<?php
+<?php
 // create object
 $object = new Example();
 
-- 
cgit v1.2.3