Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Predefined var $component in Component
#1
Experimenting a little bit with get_defined_vars() inside a component, I discovered the existence of the following predefined vars: $id, $arguments, $args, $component, $saved_args.

The component  seems to contain some of the source code from the component itself, usually html
But as soon as there appears a closing angle bracket ('>') in php code, the component seems to contain
source code FOLLOWING that angle bracker.

with the component definition
V<?php $a = 'A'; //  xyz
echo 'The predefined variable $component = '.json_encode($component);
$D ='d';
?>W
we get
VThe predefined variable $component = "VW"W

but with a '>' in front of the xyz
V<?php $a = 'A'; //  >xyz
echo 'The predefined variable $component = '.json_encode($component);
$D ='d';
?>W
results in
VThe predefined variable $component = "Vxyz\necho 'The predefined variable $component = '.json_encode($component);\n$D ='d';\n?>W"W

whereas a '>' inside the string in echo
V<?php $a = 'A'; //  xyz
echo 'The predefined> variable $component = '.json_encode($component);
$D ='d';
yields
?>WVThe predefined> variable $component = "V variable $component = '.json_encode($component);\n$D ='d';\n?>W"W

Weird. What, if any, is the purpose of this predefined variable $component?

Probably unimportant or way beyond my level of comprehension.
Reply


Messages In This Thread
Predefined var $component in Component - by vanfruniken - 2018-03-12, 09:22:11



Users browsing this thread: 1 Guest(s)