Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Merge pull request #181 from wenmingtang/master
Browse files Browse the repository at this point in the history
Add twitter_bootstrap4_translated service
  • Loading branch information
Sam Partington committed Jan 3, 2018
2 parents 9b1f3d4 + 586a333 commit b783a86
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Resources/config/pagerfanta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@
<tag name="pagerfanta.view" alias="semantic_ui" />
</service>

<!-- "twitter_bootstrap4_translated" view -->
<service id="pagerfanta.view.twitter_bootstrap4_translated" class="WhiteOctober\PagerfantaBundle\View\TwitterBootstrap4TranslatedView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap4_translated" />
<argument type="service" id="pagerfanta.view.twitter_bootstrap4" />
<argument type="service" id="translator" />
</service>

<!-- "twitter_bootstrap3_translated" view -->
<service id="pagerfanta.view.twitter_bootstrap3_translated" class="WhiteOctober\PagerfantaBundle\View\TwitterBootstrap3TranslatedView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap3_translated" />
<argument type="service" id="pagerfanta.view.twitter_bootstrap3" />
<argument type="service" id="translator" />
</service>


<!-- "twitter_bootstrap_translated" view -->
<service id="pagerfanta.view.twitter_bootstrap_translated" class="WhiteOctober\PagerfantaBundle\View\TwitterBootstrapTranslatedView" public="false">
<tag name="pagerfanta.view" alias="twitter_bootstrap_translated" />
Expand Down
28 changes: 28 additions & 0 deletions Tests/View/TwitterBootstrap4TranslatedViewTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Wenming Tang <wenming@cshome.com>
*/
namespace WhiteOctober\PagerfantaBundle\Tests\View;

class TwitterBootstrap4TranslatedView extends TwitterBootstrapTranslatedViewTest
{
protected function viewClass()
{
return 'Pagerfanta\View\TwitterBootstrap4View';
}
protected function translatedViewClass()
{
return 'WhiteOctober\PagerfantaBundle\View\TwitterBootstrap4TranslatedView';
}
protected function translatedViewName()
{
return 'twitter_bootstrap4_translated';
}
}
30 changes: 30 additions & 0 deletions View/TwitterBootstrap4TranslatedView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

/*
* This file is part of the Pagerfanta package.
*
* (c) Pablo Díez <pablodip@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Wenming Tang <wenming@cshome.com>
*/

namespace WhiteOctober\PagerfantaBundle\View;

/**
* TwitterBootstrap4TranslatedView
*
* This view renders the twitter bootstrap4 view with the text translated.
*/
class TwitterBootstrap4TranslatedView extends TwitterBootstrapTranslatedView
{
/**
* {@inheritdoc}
*/
public function getName()
{
return 'twitter_bootstrap4_translated';
}
}

0 comments on commit b783a86

Please sign in to comment.