Basic knowledge of PHP.
If you already know PHP you can skip this part.
Variables start with dollar sign($)
Functions are code blocks that you can call to do stuff. This line below calls thegetDocument function that is inside the JFactory class and stores a reference of iton the $document variable.
Every statement ends with a semicolon (;)
The equal ampersand (=&) in the middle of the variable and function saysreference that means give me the original not a copy of it.
The arrow(->) after variables mean the variable holds and object inside it andcalls a function from that object.
Comments are ignored by code and start with double slash (//)
Multi line comments are encapsulated inside
Argument are values passed to function they will use the arguments to performtheir jobs.
There’s a variable called
it means the class you are in. Example, if youare putting this in the template
will give us the document.
Code has to go inside the php tags
<?php ?> f
or it to be executed, if not itwill display on the page whatever code youtyped as normal text.
You can get the base folder where Joomla! is installed using
The value of the $this->template variable inside a template is the template folder name. This can be useful for adding the template name to a directory.
Introduction to Joomla! Api’s.