$fenom->addModifier('is_empty_array', function ($array) {
// проверяете $array и возвращаете true/false
});
в шаблоне
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | |
# $Id: Portfile 101787 2013-01-19 11:09:51Z ryandesign@macports.org $ | |
PortSystem 1.0 | |
name php5 | |
conflicts php5-devel php52 | |
# Keep version of php5 in sync with bundled php5 extension ports. | |
# Increment revision of php5-eaccelerator when updating version of php5. | |
epoch 1 |
function parseQuery() { | |
var params = {}; | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i = 0; i < vars.length; i++) { | |
var pair = vars[i].split("="); | |
if(params[pair[0]] === undefined) { | |
params[pair[0]] = [decodeURIComponent(pair[1])]; | |
} else { | |
params[pair[0]].push(decodeURIComponent(pair[1])); |
Enter a size of array: | |
11 | |
Enter array: | |
10 8 -4 3 0 -7 4 2 5 0 1 | |
Result: | |
33.000000 -320.000000 | |
10.00 8.00 5.00 4.00 3.00 2.00 1.00 0.00 0.00 -4.00 -7.00 |
/data/www/redmine/app/models/setting.rb:226:in `plugin_extra_queries' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:13:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/ |
/data/www/redmine/.rvm/gems/ruby-2.2.4/gems/actionpack-4.2.5.2/lib/action_controller/metal/strong_parameters.rb:462:in `convert_value_to_parameters' | |
/data/www/redmine/.rvm/gems/ruby-2.2.4/gems/actionpack-4.2.5.2/lib/action_controller/metal/strong_parameters.rb:456:in `convert_hashes_to_parameters' | |
/data/www/redmine/.rvm/gems/ruby-2.2.4/gems/actionpack-4.2.5.2/lib/action_controller/metal/strong_parameters.rb:351:in `[]' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:13:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch.rb:44:in `query_filter_values_with_eq' | |
/data/www/redmine/plugins/extra_queries/lib/extra_queries/field_format_record_list_patch |
function my_object() { | |
// конструктор | |
} | |
my_object.prototype = { | |
prop1: 1, | |
prop2: 2, | |
// ... прочие свойства | |
method1: function () { |
<?php | |
$template_dir = "/path/to/templates"; | |
$compile_dir = "/path/to/compiles"; | |
$options = []; | |
// Вариант 1. Если у вас уже есть свой класс, расширяющий Fenom. | |
class Templater extends Fenom { | |
use Fenom\Storage; | |
} |
export VAR1="one" VAR2="two" VAR3="three" | |
envsubst '$VAR1,$VAR2,$VAR3' <source.conf >destination.conf | |
# or | |
envsubst '$VAR1 $VAR2 $VAR3' <source.conf >destination.conf | |
# or | |
envsubst '${VAR1} ${VAR2} ${VAR3}' <source.conf >destination.conf |