-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version upgrades and cleanups #58
Closed
briancappello
wants to merge
21
commits into
symfony-cmf:master
from
VermontDesignWorks:version_upgrades
Closed
Changes from 6 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
6666e4b
update composer.json dep versions
0dd64f5
cleanups
18747ee
refactor Blog and Post into Models and move the document entities int…
899e53e
front end refactoring - repositories, controllers and templates
5c11169
refactor configuration
ac7955a
it helps to update the bundle extension when you change the configura…
948cb7c
remove everything tag related
59aec76
style consistency
2d12503
add test for blog admin create action
623798d
more tests
def6d54
use cmf shell scritps to initialize database
2e85bfe
Fix
dantleech 289b616
Merge pull request #1 from dantleech/version_upgrades
briancappello a3d9792
add blog detail test
bdc0f0e
greenlight tests on travis, hopefully
8e82d64
explicitely create node basepaths in the fixtures
ab1fc9c
perhaps a manual cache removal is necessary for travis?
6425ce0
fingers crossed
db62834
symfony <2.6 does not support closures in setAllowedValues
27bb8a4
remove superfluous code
dde14b5
convert routing auto config to xml and update composer.json
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony CMF package. | ||
* | ||
* (c) 2011-2014 Symfony CMF | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
|
||
namespace Symfony\Cmf\Bundle\BlogBundle\Controller; | ||
|
||
use Knp\Component\Pager\Paginator; | ||
use Symfony\Cmf\Bundle\BlogBundle\Model\Post; | ||
use Symfony\Cmf\Bundle\BlogBundle\Model\Blog; | ||
use Symfony\Cmf\Bundle\BlogBundle\Repository\PostRepository; | ||
use Symfony\Cmf\Bundle\CoreBundle\PublishWorkflow\PublishWorkflowChecker; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Symfony\Component\Security\Core\SecurityContextInterface; | ||
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; | ||
use FOS\RestBundle\View\ViewHandlerInterface; | ||
use FOS\RestBundle\View\View; | ||
|
||
/** | ||
* Base Controller | ||
* | ||
* @author Daniel Leech <[email protected]> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't write this :) |
||
*/ | ||
abstract class BaseController | ||
{ | ||
/** | ||
* @var EngineInterface | ||
*/ | ||
protected $templating; | ||
|
||
/** | ||
* @var SecurityContextInterface | ||
*/ | ||
protected $securityContext; | ||
|
||
/** | ||
* @var ViewHandlerInterface | ||
*/ | ||
protected $viewHandler; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param EngineInterface $templating | ||
* @param SecurityContextInterface $securityContext | ||
* @param ViewHandlerInterface $viewHandler | ||
*/ | ||
public function __construct( | ||
EngineInterface $templating, | ||
SecurityContextInterface $securityContext, | ||
ViewHandlerInterface $viewHandler = null | ||
) { | ||
$this->templating = $templating; | ||
$this->securityContext = $securityContext; | ||
$this->viewHandler = $viewHandler; | ||
} | ||
|
||
protected function renderResponse($contentTemplate, $params) | ||
{ | ||
if ($this->viewHandler) { | ||
$view = new View($params); | ||
$view->setTemplate($contentTemplate); | ||
return $this->viewHandler->handle($view); | ||
} | ||
|
||
return $this->templating->renderResponse($contentTemplate, $params); | ||
} | ||
|
||
protected function getTemplateForResponse(Request $request, $contentTemplate) | ||
{ | ||
return str_replace( | ||
array('{_format}', '{_locale}'), | ||
array($request->getRequestFormat(), $request->getLocale()), | ||
$contentTemplate | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra line