コード例 #1
0
 public function render(array $links)
 {
     $html = "";
     $urlHelper = $this->getView()->plugin('url');
     foreach ($links as $key => $value) {
         if (!StringUtils::startsWith($value, 'http')) {
             $value = $urlHelper($value);
         }
         $html .= '<a href="' . $value . '" class="social fa fa-' . $key . '"></a>' . PHP_EOL;
     }
     return $html;
 }
コード例 #2
0
 public function testStartsWith()
 {
     $string = 'A string the check';
     $check = StringUtils::startsWith($string, 'A');
     $this->assertTrue($check);
 }