• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yet Another Smarty Thread

Try this:

{foreach from=$todo_list item=items}

Note the missing $ symbol in the variable name.


[quote author="xtramix" date="1273520330"]
Note the missing $ symbol in the variable name.

I have just read Smarty Manual. error "$" symbol in the variable name (smarty syntax error).
I am edit OK...hii. Thank you very much

[eluser]gordon Stewart[/eluser]
(deleted by user)


i follow your guide but i got this message...

Fatal error: Call to undefined method Smarty:Confusedmarty() in D:\wamp\www\CodeIgniter\system\application\libraries\Smarty_parser.php on line 9

im new to CI and smarty

can you please tell me whats going on?

A PHP Error was encountered

Severity: User Notice

Message: function call 'register_resource' is unknown or deprecated.

Filename: sysplugins/smarty_internal_wrapper.php

Line Number: 57
A PHP Error was encountered

Severity: User Notice

Message: function call 'assign_by_ref' is unknown or deprecated, use 'assignByRef'

Filename: sysplugins/smarty_internal_data.php

Line Number: 79
A PHP Error was encountered

Severity: Warning

Message: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'ci_get_template' was given

Filename: sysplugins/smarty_internal_resource_registered.php

Line Number: 73

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template ci 'content_template.tpl'' in C:\xampp\htdocs\CodeIgniter\application\libraries\smarty\sysplugins\smarty_internal_template.php:163 Stack trace: #0 C:\xampp\htdocs\CodeIgniter\application\libraries\smarty\sysplugins\smarty_internal_template.php(550): Smarty_Internal_Template->isExisting(true) #1 C:\xampp\htdocs\CodeIgniter\application\libraries\smarty\Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate() #2 C:\xampp\htdocs\CodeIgniter\application\libraries\smarty_parser.php(84): Smarty->fetch('ci:content_temp...') #3 C:\xampp\htdocs\CodeIgniter\application\controllers\blog.php(11): Smarty_parser->parse('ci:content_temp...', Array) #4 C:\xampp\htdocs\CodeIgniter\system\core\CodeIgniter.php(297): Blog->index() #5 C:\xampp\htdocs\CodeIgniter\index.php(163): require_once('C:\xampp\htdocs...') #6 {main} thrown in C:\xampp\htdocs\CodeIgniter\application\libraries\smarty\sysplugins\smarty_internal_template.php on line 163

Please help me to resolve the issue.

You have to replace assign_by_ref to assignByRef in application/libraries/Smarty_parser.php

I uploaded all files and I get this error message:
Fatal error: Uncaught exception 'SmartyException' with message 'Please use parent::__construct() to call parent constuctor' in /folder/application/libraries/smarty/Smarty.class.php:785
Stack trace:
#0 [internal function]: Smarty->__call('Smarty', Array)
#1 /folder/application/libraries/smarty_parser.php(9): Smarty->Smarty()
#2 /folder/system/core/Loader.php(956): Smarty_parser->Smarty_parser(Array)
#3 /folder/system/core/Loader.php(836): CI_Loader->_ci_init_class('smarty_parser', '', NULL, NULL)
#4 /folder/system/core/Loader.php(109): CI_Loader->_ci_load_class('smarty_parser', NULL, NULL)
#5 /folder/application/controllers/smar in /folder/application/libraries/smarty/Smarty.class.php on line 785

I tryed to change to replace assign_by_ref by assignByRef but nothing. I also renamed the files to be written in lower case.

I am using Smarty 3 and CI 2.

Can anybody help?

I solved the issue above, but I get this new message:

Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'region'' in /folder/application/libraries/smarty/sysplugins/smarty_internal_template.php:163 Stack trace:
#0 /folder/application/libraries/smarty/sysplugins/smarty_internal_template.php(552): Smarty_Internal_Template->isExisting(true)
#1 /folder/application/libraries/smarty/Smarty.class.php(338): Smarty_Internal_Template->getRenderedTemplate()
#2 /folder/application/libraries/smarty_parser.php(86): Smarty->fetch('region')
#3 /folder/application/libraries/Template.php(414): Smarty_parser->parse('region', Array, true)
#4 /folder/applicat in /folder/application/libraries/smarty/sysplugins/smarty_internal_template.php on line 163

Sorry :-) Don't want to annoy you. But can someone please help?

I know I am late to this party, but just got Smarty working in my CI!!! I had existing views, so I wasn't sure how that was going to go, but I got it!

Thanks for the great instructions.

I am really new to this CI with smarty, and till now I can't see any solution to make it working as your post has shown us.

and I only knew and did with CI.

after I try to with this config I got

An Error Was Encountered

Unable to load the requested class: template


Smile I really appreciated if anyone can show me how to structure the folder. because I can't make it work with .tpl


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.