/** * @dataProvider stripBaseProvider */ public function testStripBase($input, $output, $base) { if ($base != null) { $result = URLHelper::stripBase($input, $base) == $output; } else { $result = URLHelper::stripBase($input) == $output; } $this->assertTrue($result); }
/** * Shows one particular activity * @param null $activity_id */ public function actionView($activity_id = null) { $activity_id = intval($activity_id); if ($activity_id < 1) { Apollo::getInstance()->getRequest()->error(400, 'Invalid activity ID!'); } else { $breadcrumbs = [['Activities', URLHelper::url('activity/view/' . $activity_id), true], ['Activity name (Activity ID)', null, true]]; View::render('activity.activity', 'View Activity', $breadcrumbs); } }
/** * Default function that is called if no action is specified * * @since 0.0.2 Changed to function since GenericController is no longer an interface * @since 0.0.1 */ public function index() { View::render('help.index', 'Help', [['Help', URLHelper::url('help'), true]]); }
/** * Redirects the user to specified url within the app. If $trailing_slash is set to false * the trailing slash will not be added, but existing trailing slashes won't be removed * * @param string $url * @param bool $trailing_slash * @since 0.0.8 Now uses the url() function from the URLHelper * @since 0.0.2 */ public function sendTo($url, $trailing_slash = true) { header('Location: ' . URLHelper::url($url, $trailing_slash)); die; }
/** * Shows the list of all records * * @since 0.0.4 Changed filenames * @since 0.0.2 Now using the View::render() shorthand * @since 0.0.1 */ public function index() { $breadcrumbs = [['Fields', URLHelper::url('field'), true]]; View::render('field.index', 'Fields', $breadcrumbs); }
/** * Action to deal with advanced search * * @since 0.0.8 */ public function actionSearch() { $breadcrumbs = [['Records', URLHelper::url('record'), true], ['Advanced Search', null, true]]; View::render('record.search', 'Advanced Search', $breadcrumbs); }