Skip to content

Commit

Permalink
Generated URI construction should use elseif's
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Jan 21, 2014
1 parent 3d81b00 commit ec6f996
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/templates/endpoint.twig
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ class {{ className|title }} extends AbstractEndpoint
${{ part }} = $this->{{ part }};
{% endfor %}
$uri = "{{ data.url.default }}";
{% set loopCounter = 0 %}
{% for part, info in data.url.processed %}
{% if info.count > 0 %}
{% set counter = 0 %}
if ({% for param in info.params %}{% if counter == 0 %}isset(${{ param }}) === true{% else %} && isset(${{ param }}) === true{% endif %}{% set counter = counter + 1 %}{% endfor %}) {
{% if loopCounter != 0 %}else{% set loopCounter = 1 %}{% endif %}if ({% for param in info.params %}{% if counter == 0 %}isset(${{ param }}) === true{% else %} && isset(${{ param }}) === true{% endif %}{% set counter = counter + 1 %}{% endfor %}) {
$uri = "{{ info.parsedPath }}";
}
{% endif %}
Expand Down

0 comments on commit ec6f996

Please sign in to comment.