I need to detect some variable for accessory to array type in Template toolkit. Are there best practices?
相关问题
- $ENV{$variable} in perl
- Extracting from a Union Type when some have identi
- Is it possible to pass command-line arguments to @
- Haskell: What is the differrence between `Num [a]
- Redirecting STDOUT and STDERR to a file, except fo
相关文章
- How do I get from a type to the TryParse method?
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- Java Generics: How to specify a Class type for a g
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Lazy (ungreedy) matching multiple groups using reg
- How do I tell DBD::mysql where mysql.sock is?
Your data should be validated by the controller BEFORE it's passed to the template. There should be no mystery what format your data is in.
That said, the most useful method to check this would just be testing the
array
's size:It would be possible to define a custom virtual method which returns the ref type of the variable supplied. Rough example:
Output: