(PHP 4 >= 4.3.0, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)
ncurses_wborder — Draws a border around the window using attributed characters
Diese Funktion ist EXPERIMENTELL. Das Verhalten, der Funktionsname und alles Andere, was hier dokumentiert ist, kann sich in zukünftigen PHP-Versionen ohne Ankündigung ändern. Seien Sie gewarnt und verwenden Sie diese Funktion auf eigenes Risiko.
Draws the specified lines and corners around the passed window.
Use ncurses_border() for borders around the main window.
Each parameter expects 0 to draw a line and 1 to skip it.
The window on which we operate
Top left corner
Top right corner
Bottom left corner
Bottom right corner
Note that this function is looking for the ordinal value of a character - you must pass integers, not actual characters.
For the sake of 'ease of use', I use this in my ncurses Window class:
<?php
public function border($left = '|', $top = '-', $right = '|', $bottom = '-', $tlCorner = '+', $trCorner = '+', $brCorner = '+', $blCorner = '+')
{
ncurses_wborder($this->window, ord($left), ord($right), ord($top), ord($bottom), ord($tlCorner), ord($trCorner), ord($blCorner), ord($brCorner));
}
?>
This allows you to do something like the following:
<?php
// Border the window with some weird stuff.
$window->border('.', '~', 'l', '$');
?>