We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon1.3.4 - Smarty Setting

Smarty Setting Help

-----------[ smarty install ]-----------

/ProjectName/app

/ProjectName/public

/ProjectName/Smarty

-----------[ service.php ]-----------

require_once '..\Smarty\Smarty.class.php';

$di->set('view', function () use ($config) {

    ~~~~~

    '.tpl' => function($view, $di) {

        $smarty = new Smarty($view, $di);

        $smarty->setTemplateDir($view->getViewsDir());
        $smarty->setCompileDir( '../app/viewscompiled' );
        $smarty->error_reporting = error_reporting() ^ E_NOTICE;
        $smarty->escape_html = true;
        $smarty->_file_perms = 0666;
        $smarty->_dir_perms = 0777;
        $smarty->force_compile = false;
        $smarty->compile_check = true;
        $smarty->caching = false;
        $smarty->debugging = true;

        return $smarty;
    }
    ~~~~~

-----------[ TestController.php ]-----------

class TestController extends \Phalcon\Mvc\Controller {

public function indexAction()

{

    $this->view->setVar('my_index_link', '111');

}

}

-----------[ test/index.tpl ]-----------

{$my_index_link}

[ Result ] == Brower Show Error

Call of unknown method 'render'. <------------------------- ?

Hep me.....