templating

dynamic view injection or routing

岁酱吖の 提交于 2019-12-26 03:09:06
问题 i have a JSF projekt and in there i have different views, which are backed by ManagedBeans. What i would like to achieve is to change some views while others stay where they are. this has to happen dynamically. In other words. I want to inject and remove views from an xhtml page without a page refresh. I have no clue how to achieve this. Even better would be a dynamic view injection based on urls. angularjs does that very well. But even without routing it would be great. Thanks in advance.

Get Array value by string of keys

怎甘沉沦 提交于 2019-12-25 14:48:38
问题 I'm building a template engine for my next project, which is going great. It replaces {tag} with a corresponding value. I want {tag[0][key]} to be replaced as well. All I need to know is how to get the value, if I have the string representation of the array and key, like this: $arr = array( 0 => array( 'key' => 'value' ), 1 => array( 'key' => 'value2' ) ); $tag = 'arr[0][key]'; echo($$tag); This is a very simple version of the problem, I hope you understand it. Or else I would be happy to

Get Array value by string of keys

风流意气都作罢 提交于 2019-12-25 14:48:26
问题 I'm building a template engine for my next project, which is going great. It replaces {tag} with a corresponding value. I want {tag[0][key]} to be replaced as well. All I need to know is how to get the value, if I have the string representation of the array and key, like this: $arr = array( 0 => array( 'key' => 'value' ), 1 => array( 'key' => 'value2' ) ); $tag = 'arr[0][key]'; echo($$tag); This is a very simple version of the problem, I hope you understand it. Or else I would be happy to

Symfony add default template search path

妖精的绣舞 提交于 2019-12-25 06:38:14
问题 My question is similar to this question but slightly different and since that question wasn't answered, I thought I would try again. I know Symfony will look first in app/Resources/FooBundle/views and then second in FooBundle/Resources/views for templates. I would like to "inject" another location between the two, e.g. app/Resources/FooBundle/views BarBundle/Resources/FooBundle/views FooBundle/Resources/views I've tried overriding the \Symfony\Component\HttpKernel\Config\FileLocator service

Context binding while using nested each blocks in Ember Handlebars

大兔子大兔子 提交于 2019-12-24 13:33:49
问题 I just stumbled over emberJS and thought it would be worth trying it out for my next web application. What I actually plan to do is showing a list of objects in a 2-dimensional way (atm this can be a table). What I have so far: <script type="text/x-handlebars"> <table width="100%" style="text-align:left"> <tr> <th> </th> {{#each App.MyController.getColumnValues}} <th>{{this}}</th> {{/each}} </tr> {{#each App.MyController.getRowValues}} <tr> <th>{{this}}</th> {{#each App.MyController

templating in php using tpl files

删除回忆录丶 提交于 2019-12-24 11:55:01
问题 $data = {include "header.tpl"}{include "footer.tpl"}; private function get_tpl_includes($data){ $this->includes = preg_match_all('/{include \"[^}]\"*}/', $data, $this->includes); foreach($this->includes as $include){ $tpl_file = $this->dir . str_replace($this->dir, "", $include[0]); $html_include = file_get_contents($tpl_file) or die("tp3"); //Get the content of the included html $pattern = '{include "' . $tpl_file . '"}'; //Create a pattern to replace in the html $this->html = str_ireplace(

Creating a Blank Rails 3.1 Templating Handler

孤街浪徒 提交于 2019-12-24 01:01:42
问题 What I want to do is make it just output the view itself, and ignore what Rails would normally think is embedded Ruby within the HTML. For example: <div class="current"> <div class="question"> <h3 id="homework_name"><%= homework.name %><h3 id="due">Due <%= homework.due %></h3></h3> <h2 class="title">The Question:</h2> <p id="question_contents"class="contents"><%= current_question.contents</p> </div> <div class="answer"> <h2 class="title">Your Answer:</h2> <textarea class="contents" id=

ControlTemplate for ScrollBar apply only to DataGrid

二次信任 提交于 2019-12-23 04:14:11
问题 Hello I have a ScrollBar Template as per below - only relevant portion shown: <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}"> <Grid> <Grid.RowDefinitions> <RowDefinition MaxHeight="18"/> <RowDefinition Height="0.00001*"/> <RowDefinition MaxHeight="18"/> </Grid.RowDefinitions> <Rectangle Height="35" Width="19" Fill="{StaticResource GreenTeaBrush}" Margin="-35" VerticalAlignment="Top"/> <Border.... Now the Rectangle Portion: <Rectangle Height="35" Width="19" Fill="

Using a variable to store a knockout template

谁都会走 提交于 2019-12-22 23:24:16
问题 New to knockout and loving it so far cut a 700 line jQuery mess into 150 lines. The one part I am not really liking is the templating. I want to be able to create a file similar to this module.ViewModel.views = { 'view1' : '<div data-bind="foreach: data">TEMPLATE</div>' }; // in my view model set something like ViewModel.view1Template = module.ViewModel.views.view1; // then in my html have <div data-bind="template: view1Template()"></div> I would like to be able to do this possibly with

Using a variable to store a knockout template

只谈情不闲聊 提交于 2019-12-22 23:23:53
问题 New to knockout and loving it so far cut a 700 line jQuery mess into 150 lines. The one part I am not really liking is the templating. I want to be able to create a file similar to this module.ViewModel.views = { 'view1' : '<div data-bind="foreach: data">TEMPLATE</div>' }; // in my view model set something like ViewModel.view1Template = module.ViewModel.views.view1; // then in my html have <div data-bind="template: view1Template()"></div> I would like to be able to do this possibly with