Skip to content

Commit 5b02ca2

Browse files
committed
Added a validator service for commands
1 parent 515c00e commit 5b02ca2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1211
-1592
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ install:
2121
- composer install
2222

2323
script:
24-
- ./vendor/bin/phpunit
24+
- ./vendor/bin/simple-phpunit
2525
# this checks that the source code follows the Symfony Code Syntax rules
2626
- ./vendor/bin/php-cs-fixer fix --diff --dry-run -v
2727
# this checks that the YAML config files contain no syntax errors

app/Resources/translations/messages.en.xlf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@
255255
<source>menu.rss</source>
256256
<target>Blog Posts RSS</target>
257257
</trans-unit>
258+
<trans-unit id="menu.search">
259+
<source>menu.search</source>
260+
<target>Search</target>
261+
</trans-unit>
258262

259263
<trans-unit id="post.to_publish_a_comment">
260264
<source>post.to_publish_a_comment</source>
@@ -288,6 +292,10 @@
288292
<source>post.deleted_successfully</source>
289293
<target>Post deleted successfully!</target>
290294
</trans-unit>
295+
<trans-unit id="post.search_for">
296+
<source>post.search_for</source>
297+
<target>Search for...</target>
298+
</trans-unit>
291299

292300
<trans-unit id="notification.comment_created">
293301
<source>notification.comment_created</source>

app/Resources/translations/messages.ru.xlf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@
288288
<source>post.deleted_successfully</source>
289289
<target>Запись успешно удалена!</target>
290290
</trans-unit>
291+
<trans-unit id="post.search_for">
292+
<source>post.search_for</source>
293+
<target>Искать запись...</target>
294+
</trans-unit>
291295

292296
<trans-unit id="notification.comment_created">
293297
<source>notification.comment_created</source>

app/Resources/views/base.html.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<header>
2424
<div class="navbar navbar-default navbar-static-top" role="navigation">
2525
<div class="container">
26-
<div class="navbar-header">
26+
<div class="navbar-header col-md-3 col-lg-2">
2727
<a class="navbar-brand" href="{{ path('homepage') }}">
2828
Symfony Demo
2929
</a>
@@ -64,6 +64,10 @@
6464
</li>
6565
{% endif %}
6666

67+
<li>
68+
<a href="{{ path('blog_search') }}"> <i class="fa fa-search"></i> {{ 'menu.search'|trans }}</a>
69+
</li>
70+
6771
<li class="dropdown">
6872
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" id="locales">
6973
<i class="fa fa-globe" aria-hidden="true"></i>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% block javascripts %}
4+
{{ parent() }}
5+
<script src="{{ asset('build/js/search.js') }}"></script>
6+
{% endblock %}
7+
8+
{% block main %}
9+
<form action="{{ path('blog_search') }}" method="get">
10+
<div class="form-group">
11+
<input name="q" type="text" class="form-control search-field" placeholder="{{ 'post.search_for'|trans }}" autocomplete="off" autofocus>
12+
</div>
13+
</form>
14+
15+
<div id="results">
16+
</div>
17+
{% endblock %}
18+
19+
{% block sidebar %}
20+
{{ parent() }}
21+
22+
{{ show_source_code(_self) }}
23+
{% endblock %}

app/config/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ framework:
5151
json_manifest_path: '%kernel.project_dir%/web/build/manifest.json'
5252
php_errors:
5353
log: true
54+
cache:
55+
# this value is used as part of the "namespace" generated for the cache item keys
56+
# to avoid collisions when multiple apps share the same cache backend (e.g. a Redis server)
57+
# See https://symfony.com/doc/current/reference/configuration/framework.html#prefix-seed
58+
prefix_seed: symfony-demo
5459

5560
# Twig Configuration (used for rendering application templates)
5661
twig:

app/config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242
$locales: '%app_locales%'
4343
$defaultLocale: '%locale%'
4444

45-
# needed for the localizeddate Twig filter
45+
# needed for the 'localizeddate' Twig filter
4646
Twig\Extensions\IntlExtension: ~
4747

4848
# the slugger service needs a public alias for getting it from

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ install:
4848

4949
test_script:
5050
- cd c:\projects\symfony-demo
51-
- php vendor/bin/phpunit
51+
- php vendor/bin/simple-phpunit
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)