-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smarty 4 Error - unknown tag 'counter' #947
Comments
What is the error you are getting? |
After upgrading to Smarty 4, I'm encountering an unknown tag 'counter' error. The {counter} custom function is not working as expected. The code was previously running on an older version of Smarty without any issues. {counter} " unknown tag 'counter'
|
And can you show us the code of the template that causes the error? |
sure{counter} its a tpl file and {counter} is custom function of smarty right? i cant post complete code and $this->_engine->setPluginsDir(array( |
No, I meant the source code of costcenterlist.tpl Also, try to use addPluginDir instead of setPluginDir and/or make sure your plugin dir contains the counter plugin file. |
Thank you worked |
I am stuck with smarty 4 issue unknown tag 'counter' with custom function {counter} while upgrading to smarty 4. How can i fix it. I am using php 8.2 and framework Zend.I ma new to smarty. here i provide my templater.php details :
_engine = new Smarty(); // Set Smarty configurations $this->_engine->setTemplateDir($config->paths->templates); $this->_engine->setCompileDir(sprintf('%s/tmp/templates_c', $config->paths->data)); $this->_engine->setPluginsDir(array( $config->paths->base . '/library/Templater/plugins', 'libs/plugins' )); //$this->_engine->registerBlock('t', 'smarty_translate'); $this->_engine->registerPlugin('block', 't', 'smarty_translate'); $this->_engine->debugging = true; $this->_engine->error_reporting = E_ALL & ~E_NOTICE; } public function getEngine() { return $this->_engine; } public function __set($key, $val) { $this->_engine->assign($key, $val); } public function __get($key) { return $this->_engine->getTemplateVars($key); } public function __isset($key) { return $this->_engine->getTemplateVars($key) !== null; } public function __unset($key) { $this->_engine->clearAssign($key); } public function assign($spec, $value = null) { if (is_array($spec)) { $this->_engine->assign($spec); return; } $this->_engine->assign($spec, $value); } public function clearVars() { $this->_engine->clearAllAssign(); } public function render($name) { return $this->_engine->fetch(strtolower($name)); } public function _run() {} } ?>The text was updated successfully, but these errors were encountered: