Autor Zpráva
nyllo
Profil
Dobrý den,
snažím se vytvořit louder který byde načítat šablonu. Chybu mi to žádnou nedává, ale šablonu to také nenačte.


index
$themeLoad = new presentRouter(THEME_folder_path . THEME_name);
$themeLoad->present__view(THEME_class)



presentRouter.php
class presentRouter extends Router
{
  private $themeFolder;
  private $themeClass;
   
  public function __construct($themeFolder)
  {
    $this->themeFolder = $themeFolder;
  }
  
  public function present__view($themeClass)
  {  
    $this->themeClass = $themeClass;
    include($this->themeFolder . "/" . $this->themeClass . ".phtml");
  }

}
Jan Tvrdík
Profil
nyllo:
Ten kód vypadá dobře, zkus si explicitně zapnout zobrazování chyb

error_reporting(E_ALL);
ini_set('display_errors', '1');
nyllo
Profil
Mám zapnuté a opravdu nic.

dám sem ještě celý index
error_reporting(E_ALL);
ini_set('display_errors', '1');

mb_internal_encoding("UTF-8");

function function__autoload($class)
{
  if (preg_match('/Router$/', $class))
     require("apps/router/" . $class . ".php");
}

spl_autoload_register("function__autoload");

$configLoad = new configRouter;
$configLoad->config__loader();
$libLoad = new libRouter;
$libLoad->lib__loader('Facebook/autoload');

$fb = new Facebook\Facebook([
  'app_id' => FB_app_id,
  'app_secret' => FB_app_secret,
  'default_graph_version' => FB_default_graph_version,
]);

try {
  $response = $fb->get('/'.FB_page_id.'?fields='.FB_graph_api_fields.'', FB_user_token);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo  'Graph vratil chybu: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK vratil chybu: ' . $e->getMessage();
  exit;
}

$graphNode = $response->getGraphNode();
$page = $response->getGraphPage();

$themeLoad = new presentRouter(THEME_folder_path . THEME_name);
$themeLoad->present__view(THEME_class);



Zjistil jsem že cokoliv za $themeLoad se nezobrazí a nefunguje.
$themeLoad = new presentRouter(THEME_folder_path . THEME_name);
$themeLoad->present__view(THEME_class);
visionic
Profil *
Nejsem odborník, možná jen neznalost něčeho s čím jsem se nesetkal.

není chyba zde?:
include($this->themeFolder . "/" . $this->themeClass . ".phtml");

na
include($this->themeFolder . "/" . $this->themeClass . ".html");
Jan Tvrdík
Profil
visionic:
nn, v tom kódu co poslal žádná chyba není
Davex
Profil
nyllo:
Co obsahují konstanty THEME_folder_path a THEME_name?
aDAm
Profil
co je v tom includovaném souboru?

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0