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'),
)
| call git remote add temp http://github.com/%2/%1.git | |
| call git fetch temp | |
| call git cherry-pick %3 | |
| call git remote rm temp |
| <?php | |
| /** | |
| * This file is part of the Nette Framework (http://nette.org) | |
| * | |
| * Copyright (c) 2004, 2011 David Grudl (http://davidgrudl.com) | |
| * | |
| * For the full copyright and license information, please view | |
| * the file license.txt that was distributed with this source code. | |
| */ |
Zadáním je jednoduchý a zcela běžný úkol:
| <?php | |
| class MultiplierControl extends Nette\Application\UI\Control | |
| { | |
| private $factory; | |
| public function __construct($factory) | |
| { |
| body { | |
| color: blue; | |
| } | |
| // fibonacci(40) takes 2 seconds in Node.js 0.6.14 | |
| // http://en.wikipedia.org/wiki/Fibonacci_number | |
| function fibonacci(n) { | |
| return n < 2 ? n : fibonacci(n-2) + fibonacci(n-1); | |
| } |
| <?php | |
| // history of Nette Framework Forms, year 2006 | |
| class NHtml | |
| { | |
| static protected $empty = array('img'=>1,'hr'=>1,'br'=>1,'input'=>1,'meta'=>1,'area'=>1,'base'=>1,'col'=>1,'link'=>1,'param'=>1); | |
| static public function tag($tag, $attrs=NULL, $content=NULL) |
| <?php | |
| /** | |
| * Texy parser for wiki page. | |
| */ | |
| class Parser extends Nette\Object | |
| { | |
| /** | |
| * @return void |
Homepage