示例#1
0
 /**
  * Browser visits /api
  * @return void
  */
 public function action_index()
 {
     // Here, we render the views/pages/api.php view file, pass it in the data array, and
     // return the data as a string to stick back into the data array as the layout view's
     // $content variable.
     $this->page_data['content'] = \Sleek\View::render('pages/api', $this->page_data, TRUE);
 }
示例#2
0
 /**
  * This is the page the user hits when submitting a URL via their browser.
  * @return void
  */
 public function action_submit()
 {
     $url = $this->request->post('url');
     $this->page_data['code'] = FALSE;
     if ($url && filter_var($url, FILTER_VALIDATE_URL)) {
         $EzLink = new Model_EzLink();
         $id = $EzLink->insertUrl($url);
         $this->page_data['code'] = Model_EzLink::integerToCode($id);
     }
     $this->page_data['content'] = \Sleek\View::render('pages/submit', $this->page_data, TRUE);
 }
示例#3
0
 /**
  * Renders a view and sends it to the browser. Can't be used to return strings.
  * To return a string, use \Sleek\View::render($file, $data, TRUE) instead.
  * @param string $file Path to view file to render, minus the extension
  * @param array $data Data array, ran through extract()
  * @return void
  */
 public function view($file, $data = array())
 {
     \Sleek\View::render($file, $data);
 }
示例#4
0
 /**
  * This is the page when the user visits /statistics
  * @return void
  */
 public function action_index()
 {
     $this->page_data['content'] = \Sleek\View::render('pages/statistics', $this->page_data, TRUE);
 }