Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
translateLastChild example
class
PseudoClassExtension
extends
AbstractExtension
{
public
function
getPseudoClassTranslators
(
)
: array
{
return
[
'root' =>
$this
->
translateRoot
(
...
)
,
'scope' =>
$this
->
translateScopePseudo
(
...
)
,
'first-child' =>
$this
->
translateFirstChild
(
...
)
,
'last-child' =>
$this
->
translateLastChild
(
...
)
,
'first-of-type' =>
$this
->
translateFirstOfType
(
...
)
,
'last-of-type' =>
$this
->
translateLastOfType
(
...
)
,
'only-child' =>
$this
->
translateOnlyChild
(
...
)
,
'only-of-type' =>
$this
->
translateOnlyOfType
(
...
)
,
'empty' =>
$this
->
translateEmpty
(
...
)
,
]
;
}
public
function
translateRoot
(
XPathExpr
$xpath
)
: XPathExpr
{
return
$xpath
->
addCondition
(
'not(parent::*)'
)
;
}