|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Gipsy Smarty n00b
Joined: 04 Apr 2015 Posts: 2
|
Posted: Sat Apr 04, 2015 4:36 pm Post subject: Example Application problems |
|
|
Hello everybody,
i will learn to work with smarty.
I saw the Example App "Guestbook" and i understand the example. (http://www.smarty.net/sampleapp1)
But i have two problems:
1. Start the index.php without database entries:
Code: | [i] Undefined variable: rows in C:\xampp\htdocs\guestbook\libs\guestbook.lib.php on line 137[/i] |
2. Start the link to add a new entry:
Code: | [i]<br /><b>Notice</b>: Undefined index: Name in <b>C:\xampp\htdocs\guestbook\templates_c\3349e32ab046f36b10e22ec6310c14cea064c43d.file.guestbook_form.tpl.php</b> on line <b>46</b><br />[/i] |
=> the same as comment
Can you help me?
I know that the parameters are not defined, but i have no solution.
I have downloaded and run the example.
Thanks
Gipsy |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
|
Back to top |
|
Gipsy Smarty n00b
Joined: 04 Apr 2015 Posts: 2
|
Posted: Sun Apr 05, 2015 11:18 am Post subject: |
|
|
Hello AnrDaemon,
thank you for your reply.
At least the problem in the template "guestbook_form.tpl" I have solved.
I need to check the variable if it exists.
Code: | {if !isset($post.Name)} {$post.Name = ''} {/if} |
Is that correct?
-------
Can you explain me how i can solve the other problem?
Start index.php page without database entries.
Code: | Notice: Undefined variable: rows in C:\xampp\htdocs\guestbook\libs\guestbook.lib.php on line 139 |
Do I need to check there if the variable exists?
Thanks and Regards
Gipsy |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 05, 2015 1:13 pm Post subject: |
|
|
Note that the example is some older code originally written for Smarty 2.
It assumes that you have disabled E_NOTICE messages to handle unassigned template variables and may be other variables. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|