How to call blade file to another blade file in laravel? - call

I tried
#include('footer');
to include the blade file. but it doesn't work. How can I do this?

Related

cakephp 3 Bypassing a specific folder in webroot without using .htaccess

I have a specific folder containing ViewerJS that I want to bypass without using .htaccess
The path I want to work is /ViewerJS/#/files/viewfile/version where version is some integer.
The action viewerJS is not defined in AppController
Error: Create AppController::viewerJS() in file: src/Controller/AppController.php.
Is there any way to achieve this using CakePHP routing? I have managed to get this working before with .htaccess but would much prefer a native CakePHP way.
It's really just a way to tell CakePHP to not try to find a controller etc and just treat it as a direct link.

Create csv file and pass It to backend call in React

I have a scenario where I want to create csv file and the same generated csv file I would like to pass It to backend call.
I can generate csv file using below plugin but would like to know how can I pass It to backend once file is generated?
https://www.npmjs.com/package/react-csv
Anyone please share the Idea on It?

how to make seperate Admin folder in cakephp 3

I am using cakephp 3 and first time using it.I found that I can make controller only in \src\Controller. Here I have put all front end related files. Now I want to make seperate Admin section front end. Please guide how I can do it.
You may want to look at prefixed routing:
http://book.cakephp.org/3.0/en/development/routing.html#prefix-routing
Create a folder inside src/Controller eg src/Controlelr/Admin/. Then you can create a controller src/Controller/Admin/UsersController.php and the view file src/Template/Admin/Users/edit.ctp.

CakePHP 3: How to include simple page .ctp in default.ctp

Is it possible? if yes, then how to create a simple page that uses the default.ctp page.
So I want something like the "include" features because my single pages have the same header and footer as my default.ctp and I don't want to write the import scripts (css, js) twice because the paths are differents from src/Template/Layout/default.ctp and src/Template/Pages/*.ctp
Thank you. I'm a newbie on CakePHP and I started with version 3.
You can use in your Controller's View Function:
$this->viewBuilder()->layout('custom');
This will use src/Templates/Layout/custom.ctp file instead of default.ctp
You can (but you shouldnt), only add few html tags on this file and populate everything else in your src/Templates/Pages/*.ctp files

CakePHP how to create a route for a pdf file

I've a pdf document in my CAKEPHP webroot. I want to create a route to that pdf file with the name /mydoc. I'm using CAKEPHP 1.3
When we type example.com/mydoc it should open that pdf.
Any direct ways to write direct route and it will be achieved without using controller and action.
If you're using a route, this will have to invoke a controller, in which you may output the PDF using a Cake Media View. That seems rather like overkill though. Instead, just add a URL rewrite rule to app/webroot/.htaccess:
RewriteRule ^/mydoc$ files/the_file.pdf
(Untested, may need some fiddling.) This way the file download is handled by the webserver directly without having to go through Cake.
As of CakePHP 2.9, you can put the following in your routes.php file.
Router::redirect('/mydoc', 'files/mydoc.pdf');

Resources