How to replave { }?

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
vwcd
Posts: 6
Joined: 31 May 2008, 01:28
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

How to replave { }?

Post by vwcd » 31 May 2008, 01:47

Hello,

In Portuguese we do not use the expression 5 hundreds, it is a whole word (quinhentos). When there is a sky condition like OVC005 or BKN015 I need to replace {500} or {1500} for the correct expression.

How can I do that?

Regards,

Wills

Sami Ylismäki
Site Admin
Posts: 31
Joined: 16 Jan 2008, 23:13
VATSIM ID: 878340
Location: Helsinki, Finland
Contact:

Re: How to replave { }?

Post by Sami Ylismäki » 31 May 2008, 13:44

Add replaces in the custom based on the following example:

replace:mcloud_grp:mcloud_grp:(.*)(\{500\})(.*)$:$1[quinhentos]$3

I didn't test it, but it should work. The key is to use '\' before '{' and '}' to mark those as characters and not as operators. (.*) simply means any lenght of any characters will be preserved, which is added to both sides of the searched string in order to preserve the text before and after the altitude.

vwcd
Posts: 6
Joined: 31 May 2008, 01:28
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to replave { }?

Post by vwcd » 31 May 2008, 16:28

Hello Sami,

I tried the replace command and it did not worked out. Using the debug I got the following Array:

[replace] => Array
(
[0] => Array
(
[str_match] => mcloud_grp
[str_replace] => mcloud_grp
[match] => (.*)(\500\)(.*)$
[text] => $1[quinhentos]$3
)

As you can see the system didn't recognized { or } in the \{ and \} commands. So condition is not true and the result is the same as if there is no replace condition.

Any idea?

Regards,


Wills

Sami Ylismäki
Site Admin
Posts: 31
Joined: 16 Jan 2008, 23:13
VATSIM ID: 878340
Location: Helsinki, Finland
Contact:

Re: How to replave { }?

Post by Sami Ylismäki » 31 May 2008, 16:37

I think it may be because of how the database handles arrays with {}... but it really shouldn't affect the values. Probably something else in connection to it, because it shows correctly on the page.

Sami Ylismäki
Site Admin
Posts: 31
Joined: 16 Jan 2008, 23:13
VATSIM ID: 878340
Location: Helsinki, Finland
Contact:

Re: How to replave { }?

Post by Sami Ylismäki » 31 May 2008, 16:54

It was related to it as I guessed and I've fixed it.

vwcd
Posts: 6
Joined: 31 May 2008, 01:28
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to replave { }?

Post by vwcd » 31 May 2008, 17:50

Working... Tks,

Wills

Ray Lang
Posts: 1
Joined: 27 Oct 2014, 21:54
VATSIM ID: 899884
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: How to replave { }?

Post by Ray Lang » 27 Oct 2014, 21:59

Need some help in how to fix UniAtis so it does not return [unavailable] when there is "///" in the current metar.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest