示例#1
0
 /**
  * Get a full url based on app config.
  *
  * @param  string  $path
  * @return string
  */
 function twig_style_tag($path, $media = 'screen')
 {
     $html = '<link rel="stylesheet" href="';
     if (!starting_with($path, 'http')) {
         $html .= '/assets/';
     }
     $html .= $path;
     $html .= '" media="' . $media . '" />';
     return $html;
 }
示例#2
0
 public function testStartingWith()
 {
     $this->assertTrue(starting_with('hello beautiful', 'hello'));
     $this->assertFalse(starting_with('hello beautiful', 'ahello'));
     $this->assertTrue(starting_with('hello beautiful', ''));
 }