Empty link's error message

Notice: This thread is very old.
roman.hocke
Member | 3
+
0
-

When I use

<a n:href="">

in a template (by mistake), Nette (2.2-dev) produces

<a href="error: Destination must be non-empty string.">

and doesn't show this error anywhere else. I would expect to see this error in Laděnka or somewhere else than in “href” attribute. I think my debugger is turned on in application's bootstrap.php:

$configurator->setDebugMode(TRUE);
jiri.pudil
Nette Blogger | 1028
+
0
-

You can force the presenter to throw an exception:

$presenter->invalidLinkMode = $presenter::INVALID_LINK_EXCEPTION;
Majkl578
Moderator | 1364
+
+1
-

You can also use CSS to visually highlight these links:

a[href^="error:"] {
	background: #f00;
	color: #fff;
}

JSFiddle

roman.hocke
Member | 3
+
0
-

@jiri.pudil: Thanks, this is useful, I will go examine other Presenter's options.

@Majkl: Thanks for a nice trick! But I wanted to point out that when any part of the framework produces an error, I would expect to see it in it's debugger (or log).

Last edited by roman.hocke (2014-01-19 16:06)