~ubuntu-branches/ubuntu/quantal/libtemplate-perl/quantal

« back to all changes in this revision

Viewing changes to html/modules/Template/Plugin/String.html

  • Committer: Package Import Robot
  • Author(s): Benjamin Mako Hill
  • Date: 2012-04-08 19:06:29 UTC
  • mfrom: (0.7.1) (0.5.2) (5.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20120408190629-wbcbs2ea39mex6lt
Tags: 2.24-1
* New upstream release (Closes: #664561)
* Bump Standards-Version to 3.9.3
* Changed to the short description to mention the term "Template
  Toolkit". (LP: #688836)

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
                <pre># create String objects via USE directive
166
166
<span class="tt">[% USE String %]</span>
167
167
<span class="tt">[% USE String 'initial text' %]</span>
168
 
<span class="tt">[% USE String text =&gt; 'initial text' %]</span></pre>
169
 
                    <pre># or from an existing String via new()
 
168
<span class="tt">[% USE String text =&gt; 'initial text' %]</span>
 
169
 
 
170
# or from an existing String via new()
170
171
<span class="tt">[% newstring = String.new %]</span>
171
172
<span class="tt">[% newstring = String.new('newstring text') %]</span>
172
 
<span class="tt">[% newstring = String.new( text =&gt; 'newstring text' ) %]</span></pre>
173
 
                    <pre># or from an existing String via copy()
174
 
<span class="tt">[% newstring = String.copy %]</span></pre>
175
 
                    <pre># append text to string
176
 
<span class="tt">[% String.append('text to append') %]</span></pre>
177
 
                    <pre># format left, right or center/centre padded
 
173
<span class="tt">[% newstring = String.new( text =&gt; 'newstring text' ) %]</span>
 
174
 
 
175
# or from an existing String via copy()
 
176
<span class="tt">[% newstring = String.copy %]</span>
 
177
 
 
178
# append text to string
 
179
<span class="tt">[% String.append('text to append') %]</span>
 
180
 
 
181
# format left, right or center/centre padded
178
182
<span class="tt">[% String.left(20) %]</span>
179
183
<span class="tt">[% String.right(20) %]</span>
180
184
<span class="tt">[% String.center(20) %]</span>   # American spelling
181
 
<span class="tt">[% String.centre(20) %]</span>   # European spelling</pre>
182
 
                    <pre># and various other methods...</pre>
 
185
<span class="tt">[% String.centre(20) %]</span>   # European spelling
 
186
 
 
187
# and various other methods...</pre>
183
188
              </div>
184
189
            </div>
185
190
            <div class="section">
367
372
                        </p>
368
373
                        <pre><span class="tt">[% FOREACH item.split %]</span>
369
374
     ...
370
 
<span class="tt">[% END %]</span></pre>
371
 
                        <pre><span class="tt">[% FOREACH item.split('baz|waz') %]</span>
 
375
<span class="tt">[% END %]</span>
 
376
 
 
377
<span class="tt">[% FOREACH item.split('baz|waz') %]</span>
372
378
     ...
373
379
<span class="tt">[% END %]</span></pre>
374
380
                  </div>
726
732
          </div>
727
733
          </div>
728
734
          <div class="copyright">
729
 
            Copyright &copy; 1996-2008 <a href="http://wardley.org/">Andy Wardley</a>.  All Rights Reserved.
 
735
            Copyright &copy; 1996-2012 <a href="http://wardley.org/">Andy Wardley</a>.  All Rights Reserved.
730
736
          </div>
731
737
          <div class="licence">
732
738
            The <a href="http://template-toolkit.org/">Template Toolkit</a> is <a href="http://opensource.org/">Open Source</a> software.