示例#1
0
 public function home($param = array())
 {
     $msg = array();
     $data = array();
     $data['title'] = 'Plutro - Developers Playground';
     $data['description'] = PLUTRO_META_DESC;
     $data['view'] = 'mainTemplate';
     $data['layout'] = 'homeLayout';
     $content = Plutro::getTemplate('plutro/homeLayout', $data, true);
     $data['html'] = $content;
     Plutro::loadTemplate('plutro/mainTemplate', $data);
 }
示例#2
0
 public function textCounter()
 {
     $msg = array();
     $data = array();
     $data['title'] = 'Text Counter - Plutro';
     $data['description'] = PLUTRO_META_DESC;
     $data['view'] = 'mainTemplate';
     $data['layout'] = 'textCounterLayout';
     $content = Plutro::getTemplate('plutro/textCounterLayout', $data, true);
     $data['html'] = $content;
     Plutro::loadTemplate('plutro/mainTemplate', $data);
 }
示例#3
0
 public function ajaxRandomWords()
 {
     $param = $this->input->post('param');
     if (!empty($param['amount'])) {
         $content = Plutro::getTemplate('text/stories', '', true);
         $words = str_word_count($content, 1);
         shuffle($words);
         // Get the amount of words
         $selected = array_slice($words, 0, $param['amount']);
         $implode = implode(' ', $selected);
         echo $implode;
     }
 }