Please excuse my novice status…
…but what is the equivalent of this: ?php echo date(‘Y’);? in Wappler?
Please excuse my novice status…
…but what is the equivalent of this: ?php echo date(‘Y’);? in Wappler?
Hi JR,
How would you like to use this? Where do you want to show the current year?
I use this in the footer to indicate the copyright info.
The start year and then the php code to update each year afterward, e.g. 2009 - php code
There are no issues to use this code in the page footer. There is no a “Wappler way” - it’s just PHP code
Okay, no problem… The only reason that I brought it up was because the php code didn’t appear in the Design view of the editor. There might be another method of rending this.
Well, we do not execute the PHP code in design view
Yes there is another method, using the date and time component, i just don’t see a reason not to use the php code you already have there.
Thank you for the info! I appreciate it.
This is already solved but just a silly piece of added info if you really want to use a custom piece of php code in the app connect side (client side)
Just use your custom php inside a variable
<dmx-value id="var1" value="<?php echo date(‘Y’); ?>"></dmx-value>
{{var1.value}}
The only thing to be aware of when doing this is that you use value="" and not dmx-bind:value=""
Hope this helps with future little things like this.
If you don’t require the year in dynamic data on the page I would just go with the php code directly <?php echo date('Y'); ?>
. Unless you want to use it in some App Connect expression, then use the value component. If you want to have it work without php, then the Date and Time component is the solution.