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

#31
[eluser]xtramix[/eluser]
Try this:

Code:
{foreach from=$todo_list item=items}
   <li>{$items}</li>
{/foreach}

Note the missing $ symbol in the variable name.

hth.

#32
[eluser]nhantam[/eluser]
[quote author="xtramix" date="1273520330"]
item=items
Note the missing $ symbol in the variable name.
[/quote]

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

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

#34
[eluser]Unknown[/eluser]
Summer

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?

#35
[eluser]renju[/eluser]
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.

#36
[eluser]Unknown[/eluser]
You have to replace assign_by_ref to assignByRef in application/libraries/Smarty_parser.php

#37
[eluser]suntrop[/eluser]
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?

#38
[eluser]suntrop[/eluser]
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?

#39
[eluser]Unknown[/eluser]
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.

#40
[eluser]pherum[/eluser]
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

Code:
An Error Was Encountered

Unable to load the requested class: template

:down:

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

:down:


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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