Jump to content

ComGuar

Members
  • Posts

    46
  • Joined

  • Last visited

About ComGuar

  • Birthday 09/29/1988

Profile Information

  • Gender
    Male

ComGuar's Achievements

Newbie

Newbie (1/5)

11

Reputation

  1. I agree with fastsol. My rating is 6/10. Worst things on the site is banner on the top and link color in the footer.
  2. Problem solved, i wrote function to echo included file. function echo_inc() { global $data; include "data_file.php"; echo $mydata; } $mydata = $echo_inc(); Thanks everyone for helping!
  3. Hehe we do not understand each other. Maybe i need to write function like $data = get_data('file/i_need_to_include.php'); or something like this. and $usersList->set("data", $data);
  4. No, i do this this way: foreach ($users as $user) { $row = new Template("listusers.tpl"); foreach ($user as $key => $value) { $row->set($key, $value); } $usersTemplates[] = $row; } // merge in variable $users_list = Template::merge($usersTemplates); $usersList = new Template("listusers.tpl"); $usersList->set("users", $users_list); And this is working great. Problem is when i have situation to include file with some data. This included file have sometimes more then 400 lines of code.
  5. Thanks for helping me trq. Can you tell me how to do this without template engine? Note that html code must be in template files, separated from php code.
  6. Now i do not use any template engine. Whole site is on one template, and all pages have same design, only content is changable. With template engine, there will be option to have completely different design for some pages + there will be much easier to apply new design when needed.
  7. Thanks requinix, but i'll try to find other solution. I have a lot more situations when i need to include file, not only to "show time".
  8. I want to separate the presentation from the business logic, and i wrote a class. Template engine working like any other. Example: page.tpl <html><body> <div id="content"> {{content}} </div> </body></html> index.php $content_i_want_to_add = 'yeah, this is my page content'; $content->set('content', $content_i_want_to_add); This part is working great. Problem is when i need to include file on index.php with some data that can be turned on or off. Example: index.php $content->set('content', $content_i_want_to_add); if ($show_time == "on") { include"time.php"; } // how to "set" this? time.php if ($show_time == "on") { echo '<div align="center">' . date("d.m.Y.") . '<br />' . date("H:i") . '</div>'; } This is just example, i have a lot of other, more complex, situations when i need to include a file (echo data that i include). How to solve this? Did i must to put all data in variable or there is more "elegant" way? time.php if ($show_time == "on") { $time = '<div align="center">' . date("d.m.Y.") . '<br />' . date("H:i") . '</div>'; }
  9. Thanks Darkfreaks, I will read it.
  10. On many servers gpc_magic_quotes are on and I am using stripslashes().
  11. Of course, there is htmlspecialchars() and htmlentities(). I use function to check variables and inputs as I mentioned before few posts, and I think it is doing great job.
  12. Darkfreaks, this is not my site, please check again.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.