Skip to content

Instantly share code, notes, and snippets.

View DavidBruchmann's full-sized avatar
💭
It's all about compatibility

David Bruchmann DavidBruchmann

💭
It's all about compatibility
  • Webdevelopment Barlian
  • Bandung, West Java, Indonesia
View GitHub Profile
@DavidBruchmann
DavidBruchmann / lib.navSidebar.ts
Created June 16, 2018 07:26 — forked from julrich/lib.navSidebar.ts
Fully cached TYPO3 HMENU navigation example with expAll and 'active', 'current' states
#
# Main navigation in Sidebar
#
# General idea: Don't render & cache 'active' and 'current' states in 'expAll' menu, so it becomes cacheable
# over all pages. To regain 'active' and 'current' states, the result of the cached menu is parsed by
# 'stdWrap.replacement', utilizing specific information about the resulting menu item markup to insert them.
# Use COA to decouple the stdWrap ('lib.navSidebar.stdWrap.replacement') needed for RegExp replacement from
# the cached menu ('lib.navSidebar.10'). This way the complete menu can be generically cached without current
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<polymer-element name="my-element">
// demo-array
$arr_exampleArray = array(
'name' => 'fruits and vegetables',
'purpose' => 'demo and test only.',
'usage' => 'use, play and learn by changing.',
'fruits' => array(
'sower' => array(
'citron',
'gooseberry'
),
function do_something_recursive (array $arr_someArray) {
$result = array();
foreach($arr_someArray as $key => $value) {
if(is_array($value)) {
$result[$key] = do_something_recursive (array $arr_someArray)
} else {
$result[$key] = 'Here the value '.$value.' can be used or manipulated.'
}
}
return $result;