/** * 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; }
public function testStartingWith() { $this->assertTrue(starting_with('hello beautiful', 'hello')); $this->assertFalse(starting_with('hello beautiful', 'ahello')); $this->assertTrue(starting_with('hello beautiful', '')); }