Template: Variable in alias filter not rendered.

45 views
Skip to first unread message

Alexandre Plennevaux

unread,
Feb 13, 2019, 1:53:18 PM2/13/19
to Fat-Free Framework
In the same view ("edit.htm") I have two calls to an object property :  @claim.id. One is using the alias filter, the other plain double-bracket rendering :


<a href="{{'badge_review_single_delete','id='.@claim.id | alias }}">Delete</a> <input type="hidden" name="id" value="{{ @claim.id}}">


The second line renders correctly the Claim ID value, but the first line just echoes



 i don't understand why the issue happens within the same template file. I've checked the alias filter syntaxe as per the documentation and it seems fine to me.

What am I doing wrong ?

The only suspect I see is the convoluted way the template is built :

the Controller

$f3->set('claims', $claims);
$f3->set('content', 'badgeClaim/list.htm');
$f3->set('ui', 'badgeClaim/list-loop.htm');
$view = new \Template();
echo $view->render('layout.htm');

The View is Layout.html rendering @content, which <include href="@ui">, which <include href="edit.htm"/>.








bcosca

unread,
Feb 13, 2019, 7:40:16 PM2/13/19
to f3-fra...@googlegroups.com
Try this:

<a href="{{'badge_review_single_delete',['id'=>@claim.id] | alias }}">Delete</a>

ikkez

unread,
Feb 14, 2019, 11:17:05 AM2/14/19
to Fat-Free Framework
looks good to me too.

Alexandre Plennevaux

unread,
Feb 14, 2019, 12:24:00 PM2/14/19
to bcosca via Fat-Free Framework
Thank you, but no dice. This time 
<a href="{{'badge_review_single_delete', ['id'=>@claim.id] | alias }}"  

ikkez

unread,
Feb 14, 2019, 3:46:30 PM2/14/19
to Fat-Free Framework
is claim.id correctly populated? can you just echo that variable before you build the alias link to verify that?!

Alexandre Plennevaux

unread,
Feb 22, 2019, 1:39:01 AM2/22/19
to Fat-Free Framework
Indeed it is not ! I will check if the template include "inception" could be the cause...
Reply all
Reply to author
Forward
0 new messages