In urls.py
# urls like "articles/2011/tutorial03" or "articles/2011/tutorial03.html" or "articles/2011/tutorial03.htm"
urlpatterns = patterns('',
(r'articles/(?P<year>\d+)/(?P<item>[^/]+)(?:\.htm(?:l)?)?/?\$', 'articles.detail'),
)
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<div style="width: 300px; height: 300px; background: blue"></div> |
<?php | |
declare(strict_types=1); | |
require '/nette.phar'; | |
class TypeHints | |
{ | |
public $php71 = true; |
<?php | |
/** | |
* This file is part of the Nette Framework (https://nette.org) | |
* Copyright (c) 2004 David Grudl (https://davidgrudl.com) | |
*/ | |
namespace Nette; | |
use Nette\Utils\ObjectHelpers; |
<?php | |
// transfer of a persistent parameter between two presenters without an inheritance | |
// (requires nette/application 3.0.0) | |
trait LangParameter | |
{ | |
/** @persistent */ | |
public $lang; |
services: | |
newsletter_factory: NewsletterFactory | |
newsletter_manager: @newsletter_factory::get(@templating) | |
Zadáním je jednoduchý a zcela běžný úkol:
<?php | |
declare(strict_types=1); | |
require '/nette.phar'; | |
class TypeHints | |
{ | |
public $ignoredTypes = ['mixed', 'resource']; |
<!doctype html> | |
<script> | |
if ("WebSocket" in window) { | |
var ws = new WebSocket("ws://127.0.0.1:31339"); | |
ws.onopen = function() { | |
console.log('connected'); | |
}; | |
ws.onerror = function(e) { |
<?php | |
# In-place apply the CVE-2020-15227 nette/application patch | |
# This is a universal patcher for all affected versions. | |
# Run with `php patch-CVE-2020-15227.php` | |
# Inspiration: @spazef0rze | |