Translations:Manual:Variable/7/en


 * 1) Choose a magic word ID for your variable. This is only an internal identifier that is used to tie together the various parts of the variable definition: the names that appear in wiki text, and the PHP code that assigns a value to the variable. It is best to choose an ID that will be uniquely associated with your extension and is unlikely to be confused with other magic word IDs used by other extensions.  A common strategy is to use something like   where canonicalname is the name under which you will register your extension (see Registering custom variables below).
 * 2) Define the names that will appear in wiki text. To accomplish this, you will need to define and register $magicWords in a file through $magic. Your names can be case sensitive and language dependent. See magic words for more information.
 * 3) Provide PHP code to assign a value to the variable. To accomplish this, you will need to define and register a hook function with man-hooks>Special:MyLanguage/Manual:Hooks/ParserGetVariableValueSwitch|ParserGetVariableValueSwitch.