dwoo

Reassign parent variable in included Dwoo template

Hello ! I have a Dwoo template - in example base.html and there is an array $data. {assign '' 'globalVar'} {* $globalVar empty right now *} {foreach $data element} {include '_partial.html'} {/foreach} ... <b>{$globalVar}</b> And here is _partial.html <p> {$element.someText} </p> {assign "$globalVar $element.someVar" 'gl...

PHP, Dwoo - Variables

Hi I'm trying to convert this to dwoo: foreach($duplicates as $duplicate) { echo "<tr>"; foreach($column_list as $column) { if(@$duplicate{$column . "_diff"} == 1) { $id_is_different = ''; echo "<td style=\"background: #333333\" >". $duplicate{$column} ."</td>\n"; } el...

Dwoo does not echo strings with utf8 characters

Hello ! I have got a strange problem with Zend Framework - I fetch data from MySql table that is set to utf8_general_ci. I inserted some data with polish fonts like ś ę ż... and push that data to view (Dwoo). {foreach $units unit} <tr> <td>{$unit.id_unit}</td> <td>{$unit.name}</td> </tr> ...

Dwoo - can you access other variables whilst looping?

Hi, am I right in thinking you can't access a variable from outside the loop whilst looping? For example: {loop $nav_header} <li><a href="{$link}"><img src="{$template.imagefolder}/{$icon}" width="48" height="48" border="0" alt="{$title}" /><br />{$title}</a></li> {/loop} where I'm trying to use $template.imagefolder (as an ...

Break in Smarty's / Dwoo's foreach

About break foreach ( $data as $k => $v ) { if ( $k == 4 ) { break; } } every one knows. Is there something similar in Smarty's or Dwoo's {foreach} function ? ...

How to disable Dwoo cache ?

Hi, I want to disable the cache in the template system Dwoo. Just for my dev mode. But then I tried to invoke setcache () or modify Dwoo classes and nothing works. Someone has an idea? Thank you ...

dwoo template variables inside JavaScript?

Hi everyone! i have this code. {if $loginUrl} {literal} <script type="text/javascript"> var newwindow; var intId; function login() { var screenX = typeof window.screenX != 'undefined' ? window.screenX : window.screenLeft, screenY = typeof window.screenY != 'undefined' ? window.screenY : window.sc...

Best way to include view within view in Codeigniter template using Dwoo?

I am using Codeigniter 1.7.2 and Phil Sturgeon's wonderful Dwoo wrapper which allows me to use the Dwoo template library in Codeigniter - http://philsturgeon.co.uk/code/codeigniter-dwoo I have a small question regarding the inclusion of other view template files within my template files. Say for example I have a dashboard.php file and I...

Dwoo / codeigniter: Is there a way to assign data from php to dwoo vars INSIDE templates ?

Pure dwoo equivalent would be: $dwoo->output('DwooTest/index', array('assignedVar' => 'Hello')); (I am actually using it with codeigniter - with Phil Sturgeon's library): $this->dwooParser->parse('DwooTest/index', array('assignedVar' => 'Hello')); then inside index.php {$assignedVar} //outputs 'Hello' <?php $localVar = 'Local...

How to use objects in templates in secure way

Hello everyone Modern template engines for php (say, dwoo or smarty) can use objects as variables. You can use {$obj->method()}, which is really convenient, and i am using this a lot. But, there is a clear security problem with exporting directly objects from ORM, which have methods such as insert, delete etc. Is there any sane method ...

How to make inheritance template in Pyrocms?

Pyrocms is using Dwoo template engine. In Dwoo, we can make inheritance template. {extends "default.html"}' but, I can't do this in pyrocms that using Dwoo. ...

How to include javascript script links to pyrocms page?

I'm using pyrocms to develop a system. I know that, to include style links in header tag '' in a page is by using $this->template->set_metadata(). But how can I include javascript links like that? Any answer is appreciated. ...

Is there anything like Dwoo-s {with} or {loop} in Smarty 3 or earlier?

{with} and {loop} plugins in Dwoo template engine change default context for variable name resolution. If in Dwoo you feed template: {$arr.foo} {with $arr} {$foo} / {$arr.foo} {/with} with data: array('arr' => array( 'foo' => 'bar' )) it will output: bar bar / because second {$arr.foo} actually means {$arr.arr.foo} in global c...