RISK47-FOR-LIFE
New Member
i'm having problem when i want to try implementation slim with Twig View.
the error :\[code\]Fatal error: TwigView::getEnvironment() [function.require]: Failed opening required '/Autoloader.php' (include_path='.:/opt/local/etc/php5') in /opt/local/apache2/htdocs/slim/Slim-Extras/Views/TwigView.php on line 87\[/code\]this is my code \[code\]require '/opt/local/apache2/htdocs/slim/Slim/Slim.php'; 17 require '/opt/local/apache2/htdocs/slim/Slim-Extras/Views/TwigView.php'; 18 /* 19 * initialize slim to use TwigView Handler 20 */ 21 $app = new Slim(array( 22 'view'=> new TwigView() 23 )); 24 //$app->init(array('view' => 'TwigView')); 25 $app->get('/',function() use ($app){ 26 $title = "hi there are new twig"; 27 $body = "and this is body maybe you are have idea for this content..."; 28 $data = http://stackoverflow.com/questions/10544503/array('title' => $title, 'body' => $body); 29 $app->view()->setData(array('title' => $title, 'body' => $body)); 30 $app->render('TopPage.html'); 31 // echo "hai you are coll man"; 32 33 }); 34 $app->get('/hello/',function(){ 35 echo 'Hello' ; 36 }); 37 $app->get('/hello/:name',function($name){ 38 echo "yaay...exellent ".$name; 39 }); 40 $app->run();\[/code\]how about your opinion? any suggestion? i don't know why i'm have the error like that.i'm new in slim and twig.
the error :\[code\]Fatal error: TwigView::getEnvironment() [function.require]: Failed opening required '/Autoloader.php' (include_path='.:/opt/local/etc/php5') in /opt/local/apache2/htdocs/slim/Slim-Extras/Views/TwigView.php on line 87\[/code\]this is my code \[code\]require '/opt/local/apache2/htdocs/slim/Slim/Slim.php'; 17 require '/opt/local/apache2/htdocs/slim/Slim-Extras/Views/TwigView.php'; 18 /* 19 * initialize slim to use TwigView Handler 20 */ 21 $app = new Slim(array( 22 'view'=> new TwigView() 23 )); 24 //$app->init(array('view' => 'TwigView')); 25 $app->get('/',function() use ($app){ 26 $title = "hi there are new twig"; 27 $body = "and this is body maybe you are have idea for this content..."; 28 $data = http://stackoverflow.com/questions/10544503/array('title' => $title, 'body' => $body); 29 $app->view()->setData(array('title' => $title, 'body' => $body)); 30 $app->render('TopPage.html'); 31 // echo "hai you are coll man"; 32 33 }); 34 $app->get('/hello/',function(){ 35 echo 'Hello' ; 36 }); 37 $app->get('/hello/:name',function($name){ 38 echo "yaay...exellent ".$name; 39 }); 40 $app->run();\[/code\]how about your opinion? any suggestion? i don't know why i'm have the error like that.i'm new in slim and twig.