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
0
votes
2 answers

Access to methods class in views

I have class that generate some js. Where i should put this class and how call methods from it in views? class Hits @@config = Settings.statistic class << self def js_counter if @@config.enable ... end …
Alexey
  • 2,326
  • 5
  • 17
  • 27
0
votes
2 answers

SyntaxError on nested tag helper method

So I'm writing a helper to help me fill out the carousel of bootstrap for Rails. This is the piece of code of the helper method: def carousel_item(element, active = false) content_tag :div, class:"item"+(active ? " active" : "") do …
Andres Perez
  • 149
  • 15
0
votes
1 answer

rails helper recursive block strange behaviour

Following code should accept nested code and yield in 'li' tag def sidebar_link(text,link, color = nil) recognized = Rails.application.routes.recognize_path(link) output = "" content_tag(:li, :class => ( "sticker sticker-color-#{color}" if…
Max Prokopov
  • 1,308
  • 11
  • 16
0
votes
2 answers

zend framework 2 captcha helper view render inline

I am try render the captcha element using formCaptcha Helper View how follows: $this->formElementErrors() ->setMessageOpenFormat('
') ->setMessageCloseString(''); echo…
josepmra
  • 617
  • 9
  • 25
0
votes
1 answer

Zend Framework View Helper not available in module when using layout

I'm starting to work with zend framework 1.12 and I ran into a little problem which I don't seem to be able to fix. Up untill now i've done everything in the application, but now I want to build a module that handles all stuff that is related to…
bkwint
  • 636
  • 4
  • 9
0
votes
2 answers

RoR: Moving code from view to helper

I'm trying to best understand how to use rail helpers together with haml views. I have a view which originally contained this logic = fund_levels_last(i, @fund_level_count) ? ( link_to "add new level", ad, {class: 'button orange sm'} ) : (…
charliez
  • 163
  • 2
  • 14
0
votes
2 answers

zend framework 2 Set TextDomain in onBootstrap

I followed the instructions of this link successfully, now my web is multilanguage without requiring put "locale" in the "traslate()" calls. But I have to put the TextDomain each time that I call it. $this->traslate("Hello", __NAMESPACE__)…
0
votes
2 answers

Zend Framework 2: formatting a date in a view

I'm new to Zend framework and have decided to try to build a simple app using ZF2. I have a date that is being pulled from the database where my table gateway extends the AbstractTableGateway, this is pulling my data correctly but i'd like to…
Matt
  • 2,713
  • 5
  • 27
  • 35
0
votes
1 answer

Helper function Rails 3 fails

I've done! very lucky, I was working on it for about three days, what rewrote the code at my show view like this:
    <%= @tags.each do |z| %> <% if z.name == @tag.name %>
  • <%= id = z.tagable_id %>
Julio Ahuactzin
  • 91
  • 2
  • 10
0
votes
1 answer

uninitialized constant CallsHelper::Active

I'm writing a helper in my Calls view that changes the text of a span depending on a evaluation of a date. When I write the if/else in the view I can make it work but I get the error "uninitialized constant CallsHelper::Active" when trying to…
nulltek
  • 3,247
  • 9
  • 44
  • 94
0
votes
1 answer

Transforming output of a @helper in ASP.NET MVC Razor view

Is it possible to implement a custom transformation on the output of a @helper? My point is to arrive at a solution that would allow me to have something along these lines: @helper RenderCombinedStylesheetsWithColorOverride(string color) {
aoven
  • 2,248
  • 2
  • 25
  • 36
0
votes
2 answers

Creating a method for styling purposes in rails

I have a pretty basic blog app on rails, and I need help creating a method. For each post, the user has to specify a neighborhood, and for styling purposes, I want to find out if that neighborhood falls in a certain bucket so I can color that post…
amritha
  • 75
  • 1
  • 6
0
votes
2 answers

Show/Hide div based on attribute value(checkbox value)

Is there any helper method available which shows/hides specified div based on the value of a model attribute? Here is the partial where I want to show div that wraps openid_domain_name text field if openid_enabled is true and hide otherwise while…
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
0
votes
1 answer

How should I refactor complicated If else block in view?

I have following code in my view: # panel.html.erb <% if content.content_type == "image" && content.content_image_url =~ URI::ABS_URI %> <%= image_tag content.content_image.pinboard_thumb %> <% elsif content.content_image? == false &&…