I am using Laravel 5.3
Hello,
A stranger character "-" is showing at every pages.
See my files:
My View blade contains only a single <h1> tag.
<h1>New Test</h1>
Since it's appearing on every page, you will have 2 main places where it will be:
The top of your web/routes.php file.
It will most likely be located inside your layout file. And you probably are looking for the extra '-' inside your view file which extends the layout file.
Related
i m using snappypdf and i managed to add an html footer to my file with this code in my Laravel controller:
->setOption('footer-html', view('front.mail_templates.layouts.emailFooter'))->setOption('margin-bottom',17)
but now i want to add page numbering to it, and after looking i found this solution:
->setOption('footer-right', "Page [page] of [toPage]")
The problem is i want these two to appear in my pdf but i can't make them work together they work separately but if together only html footer show and page numbering is invisible , I hovered over an empty space by chance and after copying and pasting it elsewhere, i found out it was the page number printed transparently. so is it possible to make them apear both in my footer? or any other suggestions?
EDIT
here is my footer html code :
every thing worked fine untill i added the javascript code, now it generates the following error : he exit status code '-1073741819' says something went wrong
I have a Script . there have a footer text after
</body></html>
that means end of every page .i searching all view file and some off others directories not find out that text . so is there any possibility File i can get this footer text. i have not enough knowledge in laravel ..
As you mecioned, you cant find text on your footer.
That is probably beacause you have a template for content
search line code
section('content')
or maybe
section('footer')
This is the section you are working on.
Go back to your views folder
Open app.blade.php, find yield('content') or what your looking for, there you have the code included into all views.
or maybe you have a view fooder.blade.php the footer of all views
That is templating logic on laravel, you can search all code following the sections.
If there is no a layouts folder, look for something with related name.
I am new to laravel. I have two files in two different folders. I can't access one through other.
views/layouts/header.blade.php
views/buysalerent/buy.blade.php
I want to add header.blade.php to buy.blade.php.
As you are using blade templating engine, you can include one view into another view like below
In buy.blade.php, just add
#include('layouts.header')
With the above line, header will be included into your buy.blade.php
when there is some error in view, L4 shows a nice trace, but cached filename:
open: /var/www/webpage/app/storage/views/1154ef6ad153694fd0dbc90f28999013
howto during view-rendering-to-cache save view's path/name (in a comment or something)?
Or better yet - to show it in the debug-error-page (its called whoops or something?)
Thanks ;)
I don't know how to de encrypt view names , but one method i do is to
{{dd('will you reach here ')}}
Trying to move this line from view to another to watch where php render reach .
I know it is not the right way nor the professional one , but it may help in some cases .
This is not exactly a problema, this is a compiled version of your view.
Laravel Blade System will compile all your views and subviews into a single file and, if you didn't change anything on them it will always try to use the compiled version, to speed up your system.
Sometimes is hard to know wich one of our views is related to that error. Using Sublime text, what I do is to hit CTRL-P (windows) and paste the number of the compiled view (1154ef6ad153694fd0dbc90f28999013) and it will bring it to me right away.
Of course, you won't do any changes on it. This is just way to find the view you have problems in, so you can then find the real file and fix it. If you know wich file is the problematic one, you don't have to do this, go directly to your file.
One way to tackle this problem is add a html comments (not blade ones as they will not be rendered in compiled view) in sections which get echoed.
#section('content)
<!-- FILE: app/views/main/index.blade.php -->
<Your Content Goes Here>
#stop
This html comment will get rendered in the compiled source of the view. Of course you will have to inspect the compiled view first to identify which view is the problematic one. But in my experience, this method work almost all the time.
I created a helper that checks to see if you are working locally or in development mode, It then outputs an HTML comment.
{{ printViewComment('mockup/reports#content') }}
<!-- Template: mockup/reports#content -->
I chose to name the comments like this path.file_name#yeild_name but I only wish this was an automated featured.
I found my answer after looking into source,
when on the Whoops! page, just look for render in the sidebar, there will be the name of the view file...
I'm trying to display an XML feed in a custom Joomla 2.5 component's view/layout, but the XML is rendered as a regular layout inside the site's HTML template. How can I display the XML without any template HTML code?
(The trick to include tmpl=component in the URL from this related question doesn't help, there's still some HTML output from the template that ruins the XML.)
I would prefer a solution that only involves code changes in my custom component, like in Symfony when you call the method setLayout(false).
The only solution I have found is to create a file in the current template folder, e.g. "xml.php", and put only this in the file:
<?php
$document = JFactory::getDocument();
$document->setMimeEncoding('text/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
?>
<jdoc:include type="component" />
Then I can append tmpl=xml to the URL.
[edit]
My bad, I made an assumption and you know what that gets you.
Joomla! 1.6->2.5 you can create an alternate output format for an existing view by:
calling the view with a format parameter attached e.g. &format=json
creating a matching view class file e.g. view.json.php that can sit alongside the standard view.html.php file for you view.
The view.yourformat.php file can use your existing controllers and template files in the normal fashion.
Don't forget to add either &tmpl=component or &tmpl=raw to your query string so modules etc don't load as well.
tmpl=raw won't load the html body surrounds or template, only the main component.
[/edit]
From Joomla! 1.6 onward (including 2.5) there is built in support for controller formats ie. you create a controller for the output format you want.
Normally a controller would be named for each view:
/components/mycomp/controllers/myview.php
A XML version of the controller would be name:
/components/mycomp/controllers/myview.xml.php
A JSON version would be:
/components/mycomp/controllers/myview.json.php
To call a particular format version of a controller you simply add &format=theformatyouwant to the URL parameters, so in your case &format=xml
This is discussed in this document from 1.6 days - I used it as a basis for several of our components that have JSON and ics requirements.
This issue drove me crazy a couple of times.
After much frustration, the simplest solution is the one suggested by cppl. In your query
string put the following variables:
format=yourcustomformat
view=viewname
Let say you want json output from a view called json.
Create a veiw folder with the name of your view
json
And a file inside that folder called
view.json.php
Then in your url string you include the following url parameters seperated by the & symbol:
index.php?option=com_mycomponent&format=json&view=json
cppl is correct that this loads a non-html view. However you don't have to put the tmpl parameter in at least in 2.5. If the view name is not view.html.php then 2.5 seems to not include the assigned site template in the response. I think because the view is not veiw.html.php it assumes raw output and does not include the template. I tested this with both an ajax call and a direct url call to the view and in both cases all I got back was the component output. Yeah!
If someone knows where this issue is well documented by the Joomla folks please post!