<?php
class ControllerCommonManual extends Controller {

	public function index(){

		$this->load->helper('ftr_geral');

		$language = $this->language->load('common/header');
		$this->data = array_merge($this->data, $language);

		// Manual online
		try{		
			$manual = $this->cache->get('manual');  		

			if(!$manual){
				// Documentação de parametros http://v2.wp-api.org/reference/posts/ https://developer.wordpress.com/docs/api/
				$manual = ftr_geral::callJson('http://manual.futurasistemas.com.br/wp-json/wp/v2/posts?filter[category_name]=e-commerce&context=embed&per_page=5');
				$this->cache->set('manual', $manual);
				$this->data['frequently_questions'] = $manual;
			}else{
				$this->data['frequently_questions'] = $manual ;
			}
			
		}catch(Exception $e){
			$this->data['frequently_questions'] = false ;
		}
		
		$this->response->setOutput($this->render('common/manual'));
		
	}

}
