call
- Ariadne >
- Library >
- Ariadne 2.6 >
- Manuals >
- Programmers Reference >
- Classes >
- Object >
- PHP Methods >
(mixed) call($arCallFunction="view.html", $arCallArgs="")
Finds and executes the template ($arCallFunction ) on the current object.
| Argument | Description |
|---|---|
| (string) $arCallFunction | The name of the template to call. |
| (string) $arCallArgs | The arguments to the template.
Either a RawUrlEncoded string or an Array built with
compact() |
call() tries to find the template
($arCallFunction) for the current object. If it is not defined
there, call searches the superclasses until either it or the template
'default.phtml ' is found. $arCallFunction must be the name of a
class or object template. It can be prefixed with "{classname}::", e.g.
‘call(“pobject::view.html”)’, call() will search for this template starting at the given classname. If the template is
not defined there, it tries the superclass of the given classname, and so on.
Note: If the classname is unknown, Ariadne will not find the class and PHP will issue an error message like 'failed to include the file .../lib/objects/class.phtml'.
call() initializes a few variables for use in the template to be called:
| PHP | PINP | Description |
|---|---|---|
| $this->nls | $nls | Set to either the requested nls, or the default nls of the object if the requested nls is not available. |
| $this->reqnls | $reqnls | Set to the requested nls, either entered in the url, or from the defaults of the ariadne installation. |
| $this->nlsdata | $nlsdata |
Shortcut to
$this->data->{$nls}
|
| $data | $data |
Shortcut to $this->data
|
| $flag | n.a. |
Set only when the requested nls
is not available. The variable contains an <img>
reference to the small
flag image of the default nls of the
object.
|
Other variables available in templates are:
| PHP | PINP | Description |
|---|---|---|
| $AR | n.a. | Contains most of the configuration information for this instance of Ariadne. |
| $ARBeenHere | n.a. | Contains information about how many times a each template of each object has been run, during one user request. |
| $ARConfig | n.a. | Used by CheckConfig() to store (cache) information about each object. |
| $ARCurrent | getvar() putvar() |
This variable can be used to pass around data between templates. |
| $ARnls | gettext() | Contains a list of sentences in the language set by $nls . |
Calling templates in PHP class templates:
$this->call("pobject::view.html",$arCallArgs);
$AR->user->call("view.html");
$this->call("todo.html","date=".RawUrlEncode($date));
Calling templates in PINP object templates:
call("pdir:: view.html",getvar("arCallArgs"));
call("todo.html","date=".RawUrlEncode(getvar("date")));
call("todo.html",Array("date" => getvar("date")) );

