Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional attribute with xls:if #217

Closed
Nearata opened this issue May 30, 2023 · 1 comment
Closed

Optional attribute with xls:if #217

Nearata opened this issue May 30, 2023 · 1 comment

Comments

@Nearata
Copy link

Nearata commented May 30, 2023

hello!

my goal is to use this attribute internally to update the content the end-user will see.

# Configure.php

'[nearata-dsts login="{SIMPLETEXT1}" like="{SIMPLETEXT2}" reply="{SIMPLETEXT3}" error="{SIMPLETEXT4;optional}"]{ANYTHING}[/nearata-dsts]',
resolve(Factory::class)->make('nearata-dsts::bbcode')
# bbcode.blade.php

<div class="NearataDstsBBCode">
    <div class="title">{{ $translator->trans('nearata-dsts.forum.post.bbcode.hidden_content') }}</div>
    <div class="content">
        {ANYTHING}
    </div>
    {SIMPLETEXT4} // if i use @error it doesnt work
</div>

i tried

# bbcode.blade.php

...

// no working code
<xsl:if test="@error = ''">
    {ANYTHING}
</xsl:if>
<xsl:if test="@error != ''">
    {SIMPLETEXT4} // {@error} doesnt work
</xsl:if>

but it sounds like error doesnt exist in view

Illuminate \ View \ ViewException (E_ERROR)
syntax error, unexpected end of file, expecting "elseif" or "else" or "endif" (View: D:\GitHub Repositories\Nearata\flarum-ext-dsts\views\bbcode.blade.php)
@Nearata
Copy link
Author

Nearata commented May 30, 2023

my bad, error is a variable in the view

@Nearata Nearata closed this as completed May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant