PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 1, 2022

[FIXED] How to print pattern in liquid shopify

 July 01, 2022     liquid, pattern-matching, shopify     No comments   

Issue

I'm trying to create pattern like this https://prnt.sc/1skp2s0 I'm trying it with liquid code

{% for i in (1..10) %}
{% for j in (1..10) %}
{{i}}
{% endfor %}

{% assign i=i | plus : '1' %} 
<br>

{% endfor %}

Solution

Use variable and
tag like this, it will help you to print the result like this enter image description here

{% assign j = 1 %}
{% for i in (1..10) %}
  {% for j in (1..j) %}
    {{j}}
  {% endfor %}
  {% assign j = j | plus: 1 %}
  <br/>
{% endfor %}


Answered By - Onkar
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing