I am new in Luci/lua,work on LuCI 15.05-154-gb81a22b and lua 5.1 Face problem to execute view show me bellow error
Controller syntax is bellow
e=entry({"admin","network","macclone"},arcombine(template("admin_network/mac_clone")),_("MacClone"),14)
e.leaf=true
Controller successfully call view page.
View
<%#
Copyright 2008-2009 Steven Barth <steven#midlink.org>
Copyright 2008-2015 Jo-Philipp Wich <jow#openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<%-+header-%>
<div id="cbi-network">
<h2>hello</h2>
</div>
<%-+footer-%>
View execute with error
Why this error appear?How to solve this error?
Note: header load necessary css files like:bootstrap
It says that it cant find the template admin_network/mac_clone. You need to add a model page mac_clone. Also change the
arcombine(template("admin_network/mac_clone"))
to cbi("mac_clone")
Related
I have freshly installed vs 2022 and created Umbraco 9.5.1 project. When I go to generated view, for example Views/test.cshtml and try to see the members of Model, I get nothing:
I tried setting the following option:
"Umbraco": {
"CMS": {
"ModelsBuilder": {
"ModelsMode": "SourceCodeManual",
"ModelsDirectory": "~/umbraco/models"
},
But it started giving me the following error:
How can I enable intellisense in the views?
Make sure to include all the generated files in you project/solution, as well as the view files. That should do it?
For the sake of debugging the javascript-part of a Rails 6 (version 6.0.0.rc1) web application I want to use my custom javascript functions also in the Chrome console (aka. Inspect).
Back when I used just static HTML files to build a website (as opposed to using a web-framework like Rails as of right now) you would simply embed the JS file in the DOM like this
<!-- custom JS -->
<script src="js/custom.js"></script>
and could instantly access and execute all custom functions that were placed in this file.
Background:
The JS file is placed at the correct rails 6 specific directory as provided in this article: How to require custom JS files in Rails 6
Note:
The rails 6 application also uses the JS file already, since the browser shows the console log message.
Here is the full content of the JS file:
// app/javascript/packs/custom.js
console.log("loaded custom.js successfully")
function sayHello () {
console.log("Hello good Sir or Madam!")
}
Expectation: I am expecting to open the browser's (Chrome) console and be able to use the sayHello() function in the console.
However, when I do so, I get an error message in the console stating:
Uncaught ReferenceError: sayHello is not defined
Try something like
sayHello = ()=>{
console.log("Hello good Sir or Madam!");
}
then you can evoke in console:
>sayHello();
I'm implementing polymer's app-route element in .net core mvc application.
The folder structure is :
-project
--wwwroot folder
---bower_components
---Components
----page1 folder
-page1.html
----page2 folder
-page2.html
----scaffold folder
-src
-header.html
-scaffold.html
I have implemented scaffolding with the help of app-layout element of polymer.
I have displayed tabs in the header section using the iron-selector, which when clicked redirects the user to the selected tab's appropriate page.
I have also used iron pages where-in the components have been referred.All this code is there in the header.html file.
I 'm facing issues/confused with the app-route part.exactly what path shall i give in the pattern attribute.
Below is my code :
<app-location route="{{route}}"></app-location>
<app-route route="{{route}}"
pattern="/Components/:page"
data="{{routeData}}"
tail="{{subroute}}"></app-route>
<iron-selector selected="[[page]]" attr-for-selected="data-page">
<a data-page="rewards" href="/rewards">TLG REWARDS</a>
<a data-page="earnpoints" href="/earnpoints">EARN POINTS</a>
<a data-page="redeempoints" href="/redeempoints">REDEEM POINTS</a>
</iron-selector>
<iron-pages selected="[[page]]" attr-for-selected="name"
fallback-selection="view404" role="main">
<pointbank-rewards name="rewards"></pointbank-rewards>
<pointbank-earnpoints name="earnpoints"></pointbank-earnpoints>
<pointbank-redeempoints name="redeempoints">
</pointbank-redeempoints>
</iron-pages>
Please help!!!
Regards
rizie
I've got a method in a class in an App_Code directory in my MVC 4 project. I can call this fine from controllers, but I can't figure out how to call it from an View (.cshtml) file.
namespace LST.App_Code
{
public static class Utilities
{
public static readonly log4net.ILog log = log4net.LogManager.GetLogger("GeneralLog");
From my View, I've tried several things, all along these lines:
#LST.App_Code.Utilities.log.Info("asdf");
When I do that, I receive the following compilation error when trying to load the page:
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.
Compiler Error Message: CS0433: The type 'LST.App_Code.Utilities'
exists in both
'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\bd7cb704\59585235\assembly\dl3\3b0ad3ff\ec2b5faa_0b13ce01\mvcroot.DLL'
and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\bd7cb704\59585235\App_Code.cggwncvj.dll'
Source Error:
Line 7: #using (Html.BeginForm()) Line 8: { Line 9:
#(LST.App_Code.Utilities.log.Info("asdf")) Line 10: Line 11:
#Html.AntiForgeryToken()
I've tried the suggestions about cleaning the project, the asp.net temporary files directory, and setting the batch compilation option. Nothing is working.
I'm not that familiar with the intricacies of the Razor syntax. Can someone please point me in the right direction?
I make it work with no namespace in the .cs file at all.
If you have created the app_code folder, then you can just create class files like this (without namespaces):
using System:
...
public class FooClass{
public string Foo(...)
{
...
}
}
And call it from your view like this:
#{
new FooClass().Foo(...);
}
Worked for me...
I regularly use the link wizard in my TCA.
Its horrible to find out with conditions which kind of link I have to render in Fluid (page/email/external). Is there a solution for this or do I have to create my own ViewHelper?
It seems to be undocumented, but you can pass it to <f:link.page> and it will be rendered correctly, even if it is external, email, or file link. This is because internally, <f:link.page> uses UriBuilder to build the URL, and that UriBuilder uses Typolink.
<f:link.page pageUid="{myLinkFieldValue}">My link</f:link.page>
This is the ViewHelper i´m using for this (+a helper Class):
https://gist.github.com/BenjaminBeck/7220623
I think the link.typolink ViewHelper is what you are looking for, at least for TYPO3 7.0 and above.
<f:link.typolink parameter="{link}">
Linktext
</f:link.typolink>
See Changelog Feature #59396 - TypolinkViewHelper (TYPO3 7.0)
see link.typolink in ViewHelper Reference
External Link --
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
Email --
<f:link.email additionalAttributes="{foo: 'bar'}" email="NULL" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL" name="NULL" rel="NULL" rev="NULL" target="NULL">
<!-- tag content - may be ignored! -->
</f:link.email>
Internal Link --
<f:link.page pageUid="1" additionalParams="{extension_key: {foo: 'bar'}}">page link</f:link.page>
In Fluid, there are different link view helpers:
<f:link.action action="show">action link</f:link.action>
<f:link.email email="foo#bar.tld" />
<f:link.external uri="http://www.typo3.org" target="_blank">external link</f:link.external>
<f:link.page>page link</f:link.page>
The Code (and some examples) can be found at: typo3/sysext/fluid/Classes/ViewHelpers/Link