Hello, I am trying to undestand what is smart.net for and what is it's relation with prestashop. I heard prestashop is made from smarty but I still cannot understand how to relate the two of them. I also cannot figure out how to create theme with prestashop. Can anyone else help me out? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

This is a continuation of our basic tutorial on MVC Framework. In this section, we will be creating the template files for both the TBS and the Smarty template engines. **The recap** In [part one](http://www.daniweb.com/web-development/php/tutorials/476695/part-one-php-mvc-framework-understanding-the-basics), we have created application controllers, models, and the one and only lone View class. Once again, please allow me to present few segments of those Classes here. **Main Controller** We will use this as our example. All of our application controllers have the method called index(). If we can recall from part one, we made the parent controller as an abstract class with an abstract …

Member Avatar
Member Avatar
+3 forum 9

What is the easiest way to retrieve templates from database in Smarty? I've tried http://www.smarty.net/docs/en/resources.custom.tpl to make this work, but unsuccessfull. I can't figure out how to implement it right. No errors really, it just don't work. Any suggestion or ideas?

Member Avatar
Member Avatar
+0 forum 1

Can anyone help me. my site did not show for the first time on the net because I use php and smarty, but it is showing on localhost

Member Avatar
Member Avatar
+0 forum 1

am trying to show assigned variable for failed submission on a smarty form. array assigned as $arr = array($_POST[number]); $smarty->assign(number,$arr); and on tpl form, i added as below. {foreach from=$number item=no} <input name="number[]" type="text" value="{$no[{counter start=1}]}" /> {/foreach} am starting the counter from 1 because this is for dynamically added from jquery, hence am skipping the {$no[0]} from the above input. But when form gets failed, the counter stays at 1 and does not increase. How can i increase the number counter to get the exact input array value. And I also tried, <input name="number[]" type="text" value="{foreach $smarty.request.no as $no}{$no}{/foreach}" …

Member Avatar
Member Avatar
+0 forum 2

Dear Everyone, I am considering of starting a Smarty website. Does it worth it? Is it good? Does it have any disadvantages? Or any other personal notices? Tibor

Member Avatar
Member Avatar
+0 forum 4

Hi I want to create a simple calendar on Smarty. I attached an image on how it looks so far. Here is my code **calendar.php** file: <?php require("libs/Smarty.class.php"); $smarty = new Smarty(); $date = "1/01/2013"; //January 01, 2013 $week_days = array("Sun"=>1, "Mon"=>2, "Tue"=>3, "Wed"=>4, "Thu"=>5, "Fri"=>6, "Sat"=>7); $total_day_of_month = get_total_day($date); $starting_day = $week_days[Date("D",strtotime($date))] - 1; foreach (array_keys($week_days) as $day) $days[] = $day; for ($i=0; $i<$starting_day; $i++) $days[] = "&nbsp;"; for ($i=1; $i< ($total_day_of_month+1); $i++) $days[] = $i; $smarty->assign("title","2013"); $smarty->assign("special_days", $days); $smarty->assign("TABLE", array ("title" =>"January")); $smarty->display("calendar.tpl"); $output = $smarty->fetch('calendar.tpl'); function get_total_day($date){ $time_stamp = strtotime($date); $month_ar = explode("/", $date); $month = $month_ar[0]; …

Member Avatar
Member Avatar
+0 forum 11

Hi I still learning how Smarty templates works. I can't seem to make the image appear on the Smarty Template. I try to used this `{html_image}` it doesn't work. I used `<img>` instead. <img src="images/{$book->image[tbl]}" width="115"> These are my files. This is my **index.php** <?php require("libs/Smarty.class.php"); require_once("get_data.php"); require_once("books.php"); $book = new n_books(); $smarty = new Smarty(); $smarty->assign("book",$book); $output = $smarty->fetch('index.tpl'); $smarty->display('index.tpl'); ?> This is my **index.tpl** <html> <head> <title> Book Sale </title> </head> <body> <table border="0" width="100%"> <tr> <td> <h1> Book Sale</h1> </td> </tr> </table> <table border="1" width="50%"> {section name=tbl loop=$book->title} <tr> <td align="left"> <table> <tr> <td> <img src="images/{$book->image[tbl]}" width="115"> …

Member Avatar
Member Avatar
+9 forum 7

This demo will show a PHP script using a Smarty template. It assumes basic installation. In the folder where you copy the script, there should be a smarty folder containing the Smarty files. You should create a writable `cache` and `templates_c` folder, and a folder called `templates` where the `.tpl` file should be. For example: /smarty-demo/ smarty/ templates/ arrayTemplate.tpl templates_c/ cache/ using-smarty.php The code below shows both files, so make sure you split them. The demo is using arrays and array notation in the template. It is possible to use objects and object notation as well, but I've excluded that …

Member Avatar
Member Avatar
+2 forum 4

Here is a very tiny program(3 files) has embedded with Smarty template engine. Anyone knows how to remove Smarty completely? I konw the procedure to remove Smarty but failed to rewrite the code into pure PHP. Complete source files as in attachment. **CLICK HERE!!**~~~ http://www6.mimima.com/link.php?ref=FGHkNoDtmB *****************index.php <?php require("comm/Smarty.class.php"); require_once("get_data.php"); require_once("books.php"); $book = new bo_books(); $book->apply_discount(); $smarty = new Smarty; $smarty->assign("book",$book); $smarty->display('index.tpl'); ?> ****************get_data.php <?php class books { //public public $title = array(); public $image = array(); public $author = array(); public $description = array(); public $year = array (); public $price = array(); // private private $filename = "data.txt"; //class …

Member Avatar
Member Avatar
+0 forum 6

Hi all I am stuck trying to figure out the best way to get data as at the moment I have tried a few different ways to achieve this with no luck. What I am trying to do is update a block of php code that is in my sidebar when I submit a button. I have tried loading a file with ajax but because I am using the smarty template it loads the file but the php code does not run. I have managed to get it to work to a certain point but it has to refresh the …

Member Avatar
Member Avatar
+0 forum 2

I am currently in the process of creating a open source dating script. I am nearly there. Just one thing that I can see that is an error now. When a user completes there profile, other users can see the answers, but the person who the profile belongs to can't. I presume there is something in it that is stopping the user seeing there own profile. I just can't put my finger on it. The code is as follows: Smarty TPL file <link href="includes/livevalidation/livevalidation.css" rel="stylesheet" type="text/css" media="screen"> <script language="javascript" type="text/javascript" src="includes/livevalidation/livevalidation.js"></script> <div class="profile tabs-main"> <h1>{$user.username} {lang mkey='profile'}</h1> <ul class="tabNavigation-main"> <li><a …

Member Avatar
Member Avatar
+0 forum 10

I am really in mess as I am unable to solve problem with Smarty Multi Dimension array. Below is the way I want to execute Smarty. First of all I will list all customers. Than I want list of all items purchased by that customer. I have two tables inside mysql (customer, sale). In Customer table only information related to his name and email is stored. While in sale table information related to item, price and customer is sold. Below is the way I will execute my smarty. John -Item1 -Item2 -Item3 David -Item5 -Item2 -Item7 In PHP File I …

Member Avatar
Member Avatar
+0 forum 1

Hello, I have a website that uses Smarty. When I try `$oSmart->display("header.html");` I get a blank page without warnings and errors. I'v proven with `var_dump()` that the smarty object is succesfully created. I know to that the page is enterily rendered by using: echo "start"; //Smarty Stuff echo "end"; Also the template folder is specified. Does anyone know what might have caused this? I use a ubuntu server with ispconfig and it is configurated with this turtorial: http://www.howtoforge.com/perfect-server-ubuntu-11.10-ispconfig-3. Sorry for any grammer errors, I'm from Holland. Thanl you for your time and help.

Member Avatar
Member Avatar
+0 forum 3

i'm use smarty 3 and write [CODE]$smarty = new Smarty(); $smarty->config_dir='./smarty/sconfigs/'; $smarty->template_dir='./templates/new/'; $smarty->compile_dir='./smarty/stemplates_c/'; $smarty->cache_dir='./smarty/scache/'; if(!$smarty->isCached('index.tpl','default')) { $smarty->assign("u",refresh_user_info(),true); } $smarty->display('index.tpl','default'); [/CODE] but {$u} is missing when i add if($smarty->isCached help please!

Member Avatar
+0 forum 0

Please can anyone explain me what is meant by smarty codes or templates and what is role of smarty in PHP.

Member Avatar
Member Avatar
+0 forum 3

am using an example of tooltips from [url]http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm[/url] on [url]www.euroworker.no/order[/url] I have this code here to work with, but it just doesn't seem to work correctly, I've tried everything I can think of. It's not a problem with the Smarty or html, css as far as I Can see, when I view the source, the urls for the seperate images are correct, but it only displays the image of the first item in the cart. Here's the code. [CODE]{foreach from=$cart.cartItems item="item" name="cart"} <div class="{zebra loop="cart"}"> <div id="sgproductview"> <div id="cart2Varekode"> <p> {if $product.sku} <span class="param">{$item.product.sku}</span> {else} <span>{img src=$item.Product.DefaultImage.paths.1 alt=$item.Product.name_lang|escape}</span> {/if} </p> …

Member Avatar
Member Avatar
+0 forum 1

Hi friends.... I need to learn Smarty for my next project... Plzz tell me , some good tutorials/free books... for smarty template engine, developement in coding.... If any body having softcopy ,plz send me as attachment... Thanks in advance... Saritha K

Member Avatar
Member Avatar
+0 forum 1

The End.