Questions tagged [view-helpers]

Use this tag for questions on ViewHelpers as used by the Fluid templating engine.

Viewhelpers are a part of Fluid. Fluid is a templating engine used primarily by TYPO3 and Neos.

ViewHelpers are special classes which build on base classes provided by Fluid. These classes can then be imported and used as part of the Fluid language.

More information:

423 questions
5
votes
3 answers

How to use ASP.NET MVC view precompilation with App_Code helpers?

I am trying to enable view compilation to have my ASP.NET MVC3 web site load faster. My web site is hosted on AppHarbor. However, my views make use of MVC3 view helpers, defined in the App_Code folder. When I try to load my web-site, I get: "The…
Sam
  • 770
  • 4
  • 15
5
votes
3 answers

Label is getting displayed below checkbox

<%= f.check_box :openid_enabled %> <%= f.label :openid_enabled, 'OpenID' %> Above code generate this HTML
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
5
votes
0 answers

custom base page for razor helpers

I have a project where I have several custom properties and static methods available to the base WebPage class of a Razor view... ie, I have...
Leland Richardson
  • 2,695
  • 2
  • 20
  • 27
4
votes
1 answer

Database Connection in Zend View Helper

Is it a good practice to use database mappers in Zend View Helper? Because in my case this helper is making me a box of
that keeps changing in real time and is to be shown in all the views there are in my application. I can not possibly give…
ShayanK
  • 1,243
  • 2
  • 13
  • 27
4
votes
1 answer

Get rails view helper methods inside coffeescript

I have a view helper, let say (for simplicity's sake) def call_alert return "alert 'this should appear'" end Then I have a coffeescript file some_test_page.js.coffee which renders for an action which is called via ajax. Inside this…
4
votes
1 answer

Have there been any efforts to port some of Rails' View Helpers to Javascript?

It would be great to have helpers like linkTo(), truncate(), and pluralize() in Javascript. Have there been any efforts to port some or all of Rails' view helpers to Javascript?
Adam Singer
  • 2,377
  • 3
  • 18
  • 18
4
votes
2 answers

How to compare a string with a variable in TYPO3 Fluid

I would like to do a simple comparisons, such as the equivalent of: if ($somevar === 'somestring') Now, I have found some examples where this is done like this: ... There are a number of places in the…
user9073987
4
votes
3 answers

Howto register a custom view helper that is namespaced?

I have a Zend Framework application with a custom library which is namespaced (PHP 5.3). I want to register a view helpers but I'm unable to do this due the namespace I use in the view helper. Currently I in my bootstrap I have the following to…
tom
  • 8,189
  • 12
  • 51
  • 70
4
votes
2 answers

Is it possible to load a Rails helper at run time?

I have a View that can vary significantly, depending on the 'mode' a particular user has chosen. I thought I would extract the different behavior into two different Helpers, and then have code like this in the Controller: class MyController <…
John
  • 2,121
  • 1
  • 23
  • 38
4
votes
2 answers

Zend Framework - Access to View Helper from View

I have a problem with accessing a custom view helper in a view. Call the helper in the layout.phtml works perfectly. ZF Version: 1.11.2 application.ini resources.view[] = Bootstrap: protected function _initViewSettings() { …
uniqueHxC
  • 41
  • 6
4
votes
2 answers

Converting Rails 3 to Rails 2: helpers with blocks

In Rails 3 I use the following helper in order to get a even-odd-coloured table: def bicolor_table(collection, classes = [], &block) string = "" even = 0 for item in collection string << content_tag(:tr, :class => (((even % 2 == 0) ? "even…
Alberto Santini
  • 6,425
  • 1
  • 26
  • 37
4
votes
1 answer

How does headScript() view helper work?

I'm using Zend_View_Helper_HeadScript to add JavaScript code inside the tag. $view->headScript()->appendScript($javascript); $view->headScript()->appendScript($javascript2); This works fine, except that my code is full of