
Principles
What is NOLOH?
What's so Bad About Markup?
Development and Philosophy
Features
Syntactical Sugars
Multiple Inheritance
Bookmarks and NOLOH
User State Management
Search Engine Friendly
Getting Started
PHP and NOLOH Syntax
Hello World
Constructors
Installing NOLOH
Crash Course
NOLOH and CSS
Layout in NOLOH
Databases
Data::$Links
Events in NOLOH
Moving and Resizing Your Objects
Multiple Inheritance
Bookmarks and NOLOH
Data Binding
Advanced Topics
Custom Events
Clientside Functions
Syntactic Sugars
Syntactical Sugars
Cascading
Coding Guidelines
Best Practices
NOLOH Naming ConventionsNOLOH is a completely object-oriented platform for PHP. As such, it's important to know basic PHP syntax and PHP OO syntax.
PHP is an untyped C-style language, so if you have any experience with other C-style languages, PHP syntax should be familiar to you. For more detailed information about PHP syntax, see http://us3.php.net/manual/en/langref.php
All php files begin and end with <?php, ?>
<?php ?>
PHP classes are structured in the following manner:
<?php class ClassName { } ?>
For most classes to be useful they need functions, and members. A statement in PHP is ended with a semi-colon.
<?php class ClassName { //This is a public variable, accessible to all other objects through this object public $Variable1; //This is a private variable and is only accessible from within this class private $Variable2; //This is a protected variable, accessible to this class and classes that inherit from this class protected $Variable3; //This is the class constructor, which will automatically get called when an instance of this class is created. function ClassName() { System::Alert("test"); } } ?>
To make good use of NOLOH, you must know the basics of inheritance. Inheritance is the ability to have one class extend another class and consequently have access to its parent's functions and members, while also being able to override the inherited characteristics.
<?php /*Here you can see that ChildLabel extends Label, thus it's a Label but it's also able to implement its own unique functionality*/ class ChildLabel extends Label { public $Creator; /*This variable will keep track of the Creator of this Label The following is the ChildLabel constructor and plays an important role in the object. The Constructor is a function that is called automatically when ChildLabel is created*/ function ChildLabel($creator, $text) { /*In most cases, it's important to call your parent constructor. This allows the parent constructor to execute whatever code necessary for a Label. Unless you want to override all aspects of creation, it's best always to call your parent constructor */ parent::Label($text); $this->Creator = $creator; //Sets the creator variable } } ?>
<?php class ChildLabel extends Label { public $Creator; //This variable will keep track of the Creator of this Label function ChildLabel($creator, $text) { parent::Label($text); $this->Creator = $creator; //Sets your creator variable } function AlertCreator() { System::Alert($this->Creator); } } /*Creates a new ChildLabel, with the constructor parameters of "Asher" and "My label". These correspond to the $creator, and $text variables of the constructor*/ $label = new ChildLabel("Asher", "My label"); //Calling a function of ChildLabel $label->AlertCreator(); //This above will call the AlertCreator function of ChildLabel, and Alert "Asher" ?>
These are the main things you need to know to get started using NOLOH. For more detail on NOLOH syntax, see Syntactic Sugars.






classconstantpropertymethodarticle
