This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name domain | |
root /var/www/vhosts/domain; | |
if (!-e $request_filename) { | |
rewrite /wp-admin$ $scheme://$host$uri/ permanent; | |
rewrite ^(/[^/]+)?(/wp-.*) /wp$2 last; | |
rewrite ^(/[^/]+)?(/.*\.php)$ /wp$2 last; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Serializer; | |
use JMS\Serializer\Handler\SubscribingHandlerInterface; | |
use Sonata\MediaBundle\Provider\Pool; | |
use JMS\Serializer\VisitorInterface; | |
use Application\Sonata\MediaBundle\Entity\Media; | |
use JMS\Serializer\Context; | |
use JMS\Serializer\GraphNavigator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DownloadSpecificationsController extends Controller { | |
/** | |
* @Route("/generate-pdf", name="app_generate_pdf") | |
*/ | |
public function downloadSpecifications() { | |
$html = $this->renderView('download-specifications/pdf.html.twig'); | |
$filename = sprintf('specifications-%s.pdf', date('Y-m-d-hh-ss')); | |
return new Response( | |
$this->get('knp_snappy.pdf')->getOutputFromHtml($html), | |
200, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# download-specifications/pdf.html.twig #} | |
<!doctype html> | |
<html lang="es"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i" rel="stylesheet"> | |
<link rel="stylesheet" href="{{ asset('build/base.css') }}"> | |
{% block stylesheets %}{% endblock %} | |
<title>Hello, world!</title> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="es"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="{{ absolute_url(asset(' ')) }}"> | |
{% block stylesheets %}{% endblock %} | |
<title>Title</title> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base_pdf.html.twig' %} | |
{% block body %} | |
<div class="header"> | |
<div class="header__first"> | |
<div class="row"> | |
<div class="col col_half"> | |
<img class="header__logo" src="{{ asset('logo.jpg') }}"> | |
</div> | |
<div class="col col_half"> | |
<div class="header__subtitle"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# footer.html | |
{% extends 'base_pdf.html.twig' %} | |
{% block body %} | |
<div class="footer"> | |
<div class="footer__pager"> | |
<span class="page"></span>/<span class="topage"></span> | |
</div> | |
</div> | |
<script> | |
function subst() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { PureComponent, Suspense, lazy, Fragment } from 'react'; | |
import { Route, Switch, HashRouter } from 'react-router-dom'; | |
import Loading from 'components/UI/Loading'; | |
const LoginScene = lazy(() => import('Scenes/auth/LoginScene')); | |
const ProfileScene = lazy(() => import('Scenes/user/ProfileScene')); | |
import { | |
loginRoute, | |
profileRoute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function getPostsThunk(params) { | |
return async (dispatch, getState) => { | |
try { | |
const res = await getPosts(params); | |
dispatch(getPostsSucceededAction(res.data)); | |
} catch (error) { | |
throw createApiError(error); | |
} | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"apiRequest": { | |
"cancelSource": null, | |
"cancelled": false, | |
"error": false, | |
"loading": false | |
} | |
} |
OlderNewer