method elseIfCode [line 719]
void elseIfCode(
$code, [
$separate = false])
|
|
Tags:
Parameters:
method elseIfNotVar [line 879]
QueryTemplatesParse|QueryTemplatesPhpQuery elseIfNotVar(
string
$var, [bool
$separate = false])
|
|
Wraps selected tag with PHP "else if" statement checking if $var evaluates to FALSE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
=== Template ===
<div>1</div>
<?php else if ((isset($data['foo']['bar']['0']) && ! $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && ! $data->{'foo'}->{'bar'}->{'0'})) { ?><div>2</div>
<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
div
- Text:2
PHP
div
- Text:3
Tags:
Parameters:
method elseIfPHP [line 706]
Wraps selected tag with PHP "else if" statement containing $code as condition.
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Example
Source
<node1/>
Result
<?php
else if ($foo == 1) {
?><node1/><?php
}
?>
Tags:
Parameters:
method elseIfVar [line 797]
Wraps selected tag with PHP "else if" statement checking if $var evaluates to true. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->elseIfVar('data.foo.bar.0');
=== Template ===
<div>1</div>
<?php else if ((isset($data['foo']['bar']['0']) && $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && $data->{'foo'}->{'bar'}->{'0'})) { ?><div>2</div>
<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
div
- Text:2
PHP
div
- Text:3
Tags:
Parameters:
method elsePHP [line 900]
Wraps selected tag with PHP "else" statement.
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Tags:
Parameters:
method elseStatement [line 962]
QueryTemplatesParse|QueryTemplatesPhpQuery elseStatement(
[$separate
$separate = false], [$lang
$lang = null])
|
|
TODO description
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php else { ?><div>2</div>
<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
div
- Text:2
PHP
div
- Text:3
Tags:
Parameters:
method endOnly [line 1020]
method ifCode [line 582]
unknown_type ifCode(
$code
$code, [$separate
$separate = false])
|
|
TODO doc
Tags:
Parameters:
method ifNotVar [line 663]
Wraps selected tag with PHP "if" statement checking if $var evaluates to FALSE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php if ((isset($data['foo']['bar']['0']) && ! $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && ! $data->{'foo'}->{'bar'}->{'0'})) { ?><div>2</div>
<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
div
- Text:2
PHP
div
- Text:3
Tags:
Parameters:
method ifPHP [line 476]
Wraps selected tag with PHP "if" statement containing $code as condition.
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Example
$template['node1']->tagToElseIf('$foo == 1');
Source
<node1/>
Result
<?php
else if ($foo == 1) {
?><node1/><?php
}
?>
Tags:
Parameters:
method ifVar [line 569]
Wraps selected tag with PHP "if" statement checking if $var evaluates to TRUE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Optional $separate parameter determines if selected elements should be wrapped together or one-by-one. This is usefull when stack contains non-sibling nodes.
Method doesn't change selected nodes stack.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php if ((isset($data['foo']['bar']['0']) && $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && $data->{'foo'}->{'bar'}->{'0'})) { ?><div>2</div>
<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
div
- Text:2
PHP
div
- Text:3
Tags:
Parameters:
method onlyIf [line 1000]
TODO docs
Tags:
Parameters:
method onlyIfNot [line 1012]
TODO docs
Tags:
Parameters:
method onlyJS [line 992]
TODO Move to jsCode plugin.
Tags:
method onlyPHP [line 984]
Honors code between onlyPHP and endOnly, only for PHP templates.
TODO: Is theres something wrong with this name ?
Tags:
method tagToElseIfNotVar [line 413]
Replaces selected tag with PHP "else if" statement checking if $var evaluates to FALSE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Method doesn't change selected nodes stack. detached from it's parent.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php else if ((isset($data['foo']['bar']['0']) && ! $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && ! $data->{'foo'}->{'bar'}->{'0'})) { ?>2<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
Text:2
PHP
div
- Text:3
Tags:
Parameters:
method tagToElseIfPHP [line 247]
Replaces selected tag with PHP "else if" statement containing $code as condition.
Method doesn't change selected nodes stack. detached from it's parent.
Example
Source
<div class='else-if'><node1/></div>
Result
<?php
else if ($foo == 1) {
?><node1/><?php
}
?>
Tags:
Parameters:
method tagToElseIfVar [line 332]
Replaces selected tag with PHP "else if" statement checking if $var evaluates to TRUE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Method doesn't change selected nodes stack. detached from it's parent.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php else if ((isset($data['foo']['bar']['0']) && $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && $data->{'foo'}->{'bar'}->{'0'})) { ?>2<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
Text:2
PHP
div
- Text:3
Tags:
Parameters:
method tagToElsePHP [line 426]
method tagToElseStatement [line 423]
void tagToElseStatement(
)
|
|
Tags:
method tagToIfNotVar [line 207]
Replaces selected tag with PHP "if" statement checking if $var evaluates to FALSE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Method doesn't change selected nodes stack. detached from it's parent.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php if ((isset($data['foo']['bar']['0']) && ! $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && ! $data->{'foo'}->{'bar'}->{'0'})) { ?>2<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
Text:2
PHP
div
- Text:3
Tags:
Parameters:
method tagToIfPHP [line 41]
Replaces selected tag with PHP "if" statement containing $code as condition.
Method doesn't change selected nodes stack. detached from it's parent.
Example
Source
<div class='if'><node1/></div>
Result
<?php
if ($foo == 1) {
?><node1/><?php
}
?>
Tags:
Parameters:
method tagToIfVar [line 126]
Replaces selected tag with PHP "if" statement checking if $var evaluates to TRUE. $var must be available inside template's scope.
$var is passed in JavaScript object notation (dot separated).
Method doesn't change selected nodes stack. detached from it's parent.
Notice-safe.
== Example ==
=== Markup ===
<div>1</div>
<div>2</div>
<div>3</div>
=== Data ===
$data = array(
'foo' => array(
'bar' => array(true)
)
);
=== `QueryTemplates` formula ===
$template['div:eq(1)']->
;
=== Template ===
<div>1</div>
<?php if ((isset($data['foo']['bar']['0']) && $data['foo']['bar']['0']) || (isset($data->{'foo'}->{'bar'}->{'0'}) && $data->{'foo'}->{'bar'}->{'0'})) { ?>2<?php } ?>
<div>3</div>
=== Template tree before ===
div
- Text:1
div
- Text:2
div
- Text:3
=== Template tree after ===
div
- Text:1
PHP
Text:2
PHP
div
- Text:3
Tags:
Parameters:
method _if [line 479]
void _if(
$lang,
$code, [
$separate = false])
|
|
Tags:
Parameters:
method _tagToElse [line 429]