示例#1
0
 function __construct()
 {
     date_default_timezone_set('Asia/Kuala_Lumpur');
     $detect = new Mobile_Detect();
     Plutro::$detect = $detect;
     Plutro::$isMobile = $detect->isMobile();
     Plutro::$CI =& get_instance();
     // self::$CI->lang->load('english_lang', 'english');
 }
示例#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 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);
 }
示例#4
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;
     }
 }