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

zf2 Creation of simple service and access it through viewhelper

I am trying to create a simple service in zf2 which I can access using in viewhelper Step1. I have craeted a class in src/Application/Service/Service1.php as follow namespace Application\Service; use…
Developer
  • 25,073
  • 20
  • 81
  • 128
9
votes
1 answer

Difference between DisplayFor and ValueFor

I'm wondering what the difference is between ValueFor, which I didn't know until recently, and DisplayFor, which I've been using for displaying values. I set up a test project in which I created a Model with 2 properties: public class TestModel { …
Mickaël Derriey
  • 12,796
  • 1
  • 53
  • 57
9
votes
3 answers

Open .chm file at specific page/topic using command line arguments

I am attempting to open a .chm file(A windows help file) at a specific page/topic by using a system call in C++. I can successfully open the .chm file to the start page through the following code, but how can I open a .chm file to a specific…
sazr
  • 24,984
  • 66
  • 194
  • 362
8
votes
1 answer

Zend Framework - plugin by name was not found in registry

When calling a function in my views/helpers/ file, from my script inside views/scripts/ , i get this error: Message: Plugin by name 'SetBlnCompany' was not found in the registry; used paths: My_View_Helper_: …
adam
  • 2,930
  • 7
  • 54
  • 89
8
votes
4 answers

use TempData in a Helper error: The name 'TempData' does not exist in the current context

I would like to access the TempData in my helper for a flash message (like in ruby) I get a runtime error of The name 'TempData' does not exist in the current context my Flash.cshtml is as follows @helper Show() { var message = "test…
eiu165
  • 6,101
  • 10
  • 41
  • 59
8
votes
3 answers

Rails 3 View helper method in Model

I have a class method in my model, and I need to access a method from one of my view helpers. Currently I am including include TalkHelper, but I still get a NoMethodError.
LanguagesNamedAfterCofee
  • 5,782
  • 7
  • 45
  • 72
8
votes
2 answers

Ruby on Rails content_tag options hash - setting a boolean html attribute?

Boolean attributes, as defined in the html 5 draft specification: http://dev.w3.org/html5/spec/Overview.html#boolean-attributes The presence of a boolean attribute on an element represents the true value, and the absence of the attribute …
nzifnab
  • 15,876
  • 3
  • 50
  • 65
8
votes
1 answer

Rails: Render view content in post-processor (model / helper issues)

I have a web app in which I also have quite a complex type of blog. For this blog I use both RedCarpet as markup language in addition to a homemade markup language, that is very useful. In my homemade markup language I call Product-views and other…
Christoffer
  • 2,271
  • 3
  • 26
  • 57
7
votes
1 answer

Removing parameters from URL when using Url view helper links

When using the Url view helper to build links, if the current page has parameters in the url, the url generated by the Url view helper will contains parameters as well. For instance in the page /controller/action/param/value/ the following code:
user122830
7
votes
3 answers

Razor @helper in App_Code cannot be accessed

In my App_code, I have a helper function called FormatTelephone(string number) in Formatter.cshtml. I tried to access it in a partial view by @Formatter.FormatTelephone(number). When I test it, it says Compiler Error Message: CS0103: The name…
uni
  • 613
  • 1
  • 7
  • 11
7
votes
2 answers

Use a Rails helper in a model

Possible Duplicate: Access a view helper for a model in rails I know this is probably not something I should do often, but I want to use a helper within a model. I'm generating a spreadsheet in a Report model and would like to use the…
Joe Flynn
  • 6,908
  • 6
  • 31
  • 44
7
votes
1 answer

Laravel: How to get the current url as a view helper with parameters

I want to build a link in my view that refers to the same page like that one where its placed on. And I want to be able to give a parameter with. For example I want to change languages. I have a route like domain.com/{lang}/xyz And in my view I…
Fabian
  • 1,806
  • 5
  • 25
  • 40
7
votes
1 answer

Zend Framework 2 - How to include partial from library

I wrote a partial which I want to use in several modules. I thought the best way would be to put it into my custom library. But unfortunately I couldn't figure out a way to include this partial without using a very ugly path like: echo…
Jonas
  • 302
  • 2
  • 13
7
votes
5 answers

ZF2 Breadcrumbs Helper - How to render it as an unordered list?

I'm new to Zend Framework2 and I´m asking for advice for the following situation: I´m using the ZF2 Breadcrumbs Helper to create breadcrums on my project and this code: //breadcrumbs.phtml echo $this->navigation('Navigation') …
devanerd
  • 365
  • 4
  • 12
6
votes
4 answers

I want to create a method that will be available in all controllers, and views

i am making a ecommerce application in which the categories are visible in side bar on all pages. i wrote a method in application controller def categories @categories = Category.all end but how can i make this method available to all…
imran
  • 626
  • 2
  • 13
  • 24
1
2
3
28 29