phalcon volt extend not work - phalcon

Taking problem with usibg extends in template
application/views/index/index.volt
first(actrually only one) line is:
{% extends common/index.volt %}
receive this:
Fatal error: Uncaught exception 'Phalcon\Mvc\View\Exception' with
message 'Extends statement must be placed at the first line in the
template in ../application/views/index/index.volt on line 1' in
....\public_html\index.php on line 169
....\public_html\index.php line 169 is:
echo $application->handle()->getContent();
In demos http://docs.phalconphp.com/ru/latest/reference/volt.html#id33 just used including
So just cant understend if phalcon support extends or not

Maybe your editor has inserted a BOM at the beginning of the .volt file? Go to your editor's encoding options (or the encoding menu) and choose "UTF-8 without BOM".

Related

No matter what programme I write , it is showing invalid syntax. Eg. If I write a=45 print(a), it says name a is not defined?

a= 45
print (a)
It starts saying name "a" is not defined
What to do?
Even if I copy code from somewhere and paste then it says invalid syntax..
Even if I type in everything correct, the response is same as invalid syntax.
Write it in two lines code
a=45
print(a)
There could be 2 simple reason for this error
First reason:
You could been writing in another file not the .py file, for example, it will give you error if you're file is a .css or .html or .js or .java etc.
Second reason:
It could be an error writing in a line for example it should be
a = 45
print (a)

Yii 1.1.8 - Error messages without line numbers

I have a simple issue "Array and string offset access syntax with curly braces is deprecated", but I am not sure where to go to fix it.
How do I enable line numbers to show?
you can activate the debug function in main.php file. This file located in protected/config folder.
Edit as following:
locate the 'log' array inside the file
uncomment the CWebLogRoute in the array
If you do it right, then when error shows up, you can see the error location.
How your main.php log config looks like when uncomment

Link to static JSON file

In Docusaurus V2 how to link to a JSON file in the static folder?
I tried the following in a markdown file:
An exemple, is the following [JSON dataset](../../static/data/solar-radiation.json).
But Docusaurus then produce the following error:
./static/data/solar-radiation.json (./node_modules/file-loader/dist/cjs.js?name=assets/files/[name]-[hash].[ext]!./static/data/solar-radiation.json)
Module parse failed: Unexpected token e in JSON at position 0 while parsing near 'export default __web...'
File was processed with these loaders:
* ./node_modules/file-loader/dist/cjs.js
You may need an additional loader to handle the result of these loaders.
SyntaxError: Unexpected token e in JSON at position 0 while parsing near 'export default __web...'
at JSON.parse (<anonymous>)
My file is a valid JSON. For some reason, instead of displaying a static file Docusaurus seems to try to parse it...
I saw the same problem. My temporary solution is:
Change file name from .md to .mdx
Add this link to your json file
<a target="_blank" href="/json/file.json" download="file.json">Download</a>
I've also had the same problem!
According to the Issue #3561 on the Docusaurus GitHub, word from one of the developers is that the current best practise is to use the pathname:// prefix in front of your URL. To use your example:
An exemple, is the following
[JSON dataset](pathname://../../static/data/solar-radiation.json).
Apparently the reason why this happens is because there is a conflict between the babel-loader (used to load code) and the file-loader (used to load static assets). The pathname:// prefix skips both of these loaders, and just creates a link instead.

LESS Compiler: Unexpected token u

When I attempt to compile a LESS template in Visual Studio using Web Essentials, I receive an error that says "Unexpected token u" with no file name, no line number, and no column number. Why is this happening?
Go to %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\12.0\Extensions which is the folder where per-user Visual Studio extensions reside. WebEssentials will be located in a subfolder with a randomly generated name.
From inside the WebEssentials folder, open up the file Resources\nodejs\tools\server\services\srv-less.js and go to line 65, which reads:
map = JSON.parse(output.map);
The problem is source map output may be the undefined value. JSON.parse can only parse strings, so it casts that to the string value "undefined" before parsing, but JSON does not recognize that as valid token. (It only understands the null value, not the undefined value.)
So... change line 65 to read:
map = JSON.parse(output.map || "null");
And voilĂ ; LESS compilation on files with empty output works again.
Source:
https://github.com/madskristensen/WebEssentials2013/issues/1696
From my experience, this error occurs when LESS attempts to output a CSS file from a LESS file, and the resulting CSS file is empty. In my case, this happened after removing some font-face declarations, which left the resulting CSS file empty. LESS would not compile until I added a class that would output to the CSS file.
Details may be found here: https://github.com/madskristensen/WebEssentials2013/issues/1696
I'm adding this to StackOverflow because I'm unable to access Github at my workplace. I hope this helps someone.
You can also add in your less file an important comment /**/ or #charset "utf-8"; as described here https://github.com/madskristensen/WebEssentials2013/issues/1696

FPDF - How to remove a vertical line in the generated file

I am trying to generate a PDF file from an html content using FPDF
$this->pdf->AddPage();
$html = "Hello World";
$footer = "Footer";
$this->pdf->WriteHTML($html);
$this->pdf->SetXY(1,255);
$this->pdf->MultiCell(208, 20, $footer, 0, "C", false, 0, '','',true,0,true,true,0,'B',false);
The generated file contains a vertical line on the top of the page (above Hello World). After few tests I found out that it's added by AddPage(), I get that it's sort of a seperator of pages but I don't want to keep it and didn't find how to remove it.
Also, it doesn't seem like a common issue so I don't know if I'm missing something...
I think you are using TCPDF instead of FPDF. So just disable the automated page header via the setPrintHeader() method.
Open the api's code, go to the AddPage() function and modify it...remove the line that is being added.