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); }
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); }
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; } }