Hello,
I guess there is something I am missing about DynPages.
So, I installed the plug-in.
On my GS Page, I make a call to a component :
{% helloworld %}
I created a component calle helloworld.
<?php echo "hello world"; ?>
This works and displays "hello world" in the page.
My problem is with arguments, I try to pass arguments.
I modify the component like this : <?php echo "hello world $args[0]"; ?>
I make a call like this in the page {% helloworld humans %}
My expectations is to see : "hello world humans"
but I have "hello world".
What I am missing ? Thanks for any help.
------
EDITED :
I managed to solve it myself.
Do not forget to redefine the variable as a global variable in the component.
<?php
global $args;
echo "hello world $args[0]";
?>
I guess there is something I am missing about DynPages.
So, I installed the plug-in.
On my GS Page, I make a call to a component :
{% helloworld %}
I created a component calle helloworld.
<?php echo "hello world"; ?>
This works and displays "hello world" in the page.
My problem is with arguments, I try to pass arguments.
I modify the component like this : <?php echo "hello world $args[0]"; ?>
I make a call like this in the page {% helloworld humans %}
My expectations is to see : "hello world humans"
but I have "hello world".
What I am missing ? Thanks for any help.
------
EDITED :
I managed to solve it myself.
Do not forget to redefine the variable as a global variable in the component.
<?php
global $args;
echo "hello world $args[0]";
?>