Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c0b23d17 authored by Florian Eckerstorfer's avatar Florian Eckerstorfer
Browse files

Updated PHPDocs

parent 72300732
Branches
Tags
No related merge requests found
...@@ -184,6 +184,7 @@ class BcBootstrapExtension extends Extension implements PrependExtensionInterfac ...@@ -184,6 +184,7 @@ class BcBootstrapExtension extends Extension implements PrependExtensionInterfac
private function buildAsseticConfig(array $config) private function buildAsseticConfig(array $config)
{ {
$output = array(); $output = array();
if ($config['less_filter'] !== 'none') { if ($config['less_filter'] !== 'none') {
$output['bootstrap_css'] = $this->buildAsseticBootstrapCssWithLessConfig($config); $output['bootstrap_css'] = $this->buildAsseticBootstrapCssWithLessConfig($config);
} else { } else {
...@@ -191,6 +192,7 @@ class BcBootstrapExtension extends Extension implements PrependExtensionInterfac ...@@ -191,6 +192,7 @@ class BcBootstrapExtension extends Extension implements PrependExtensionInterfac
} }
$output['bootstrap_js'] = $this->buildAsseticBootstrapJsConfig($config); $output['bootstrap_js'] = $this->buildAsseticBootstrapJsConfig($config);
$output['jquery'] = $this->buildAsseticJqueryConfig($config); $output['jquery'] = $this->buildAsseticJqueryConfig($config);
return $output; return $output;
} }
......
<?php <?php
/**
* This file is part of BcBootstrapBundle.
* (c) 2012-2013 by Florian Eckerstorfer
*/
namespace Bc\Bundle\BootstrapBundle\Form\Extension; namespace Bc\Bundle\BootstrapBundle\Form\Extension;
...@@ -6,13 +10,31 @@ use Symfony\Component\Form\AbstractTypeExtension; ...@@ -6,13 +10,31 @@ use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
/**
* TypeSetterExtension
*
* @package BcBootstrapBundle
* @subpackage Form
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2013 Florian Eckerstorfer
* @license http://opensource.org/licenses/MIT The MIT License
* @link http://bootstrap.braincrafted.com Bootstrap for Symfony2
*
* @codeCoverageIgnore
*/
class TypeSetterExtension extends AbstractTypeExtension class TypeSetterExtension extends AbstractTypeExtension
{ {
/**
* {@inheritDoc}
*/
public function buildView(FormView $view, FormInterface $form, array $options) public function buildView(FormView $view, FormInterface $form, array $options)
{ {
$view->vars['original_type'] = $form->getConfig()->getType()->getName(); $view->vars['original_type'] = $form->getConfig()->getType()->getName();
} }
/**
* {@inheritDoc}
*/
public function getExtendedType() public function getExtendedType()
{ {
return "form"; return "form";
......
<?php <?php
/**
* This file is part of BcBootstrapBundle.
* (c) 2012-2013 by Florian Eckerstorfer
*/
namespace Bc\Bundle\BootstrapBundle\Form\Type; namespace Bc\Bundle\BootstrapBundle\Form\Type;
...@@ -10,6 +14,16 @@ use Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener; ...@@ -10,6 +14,16 @@ use Symfony\Component\Form\Extension\Core\EventListener\ResizeFormListener;
use Symfony\Component\OptionsResolver\Options; use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* MoneyType
*
* @package BcBootstrapBundle
* @subpackage Form
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2013 Florian Eckerstorfer
* @license http://opensource.org/licenses/MIT The MIT License
* @link http://bootstrap.braincrafted.com Bootstrap for Symfony2
*/
class BootstrapCollectionType extends AbstractType class BootstrapCollectionType extends AbstractType
{ {
/** /**
...@@ -17,14 +31,17 @@ class BootstrapCollectionType extends AbstractType ...@@ -17,14 +31,17 @@ class BootstrapCollectionType extends AbstractType
*/ */
public function buildView(FormView $view, FormInterface $form, array $options) public function buildView(FormView $view, FormInterface $form, array $options)
{ {
$view->vars = array_replace($view->vars, array( $view->vars = array_replace(
'allow_add' => $options['allow_add'], $view->vars,
'allow_delete' => $options['allow_delete'], array(
'add_button_text' => $options['add_button_text'], 'allow_add' => $options['allow_add'],
'delete_button_text' => $options['delete_button_text'], 'allow_delete' => $options['allow_delete'],
'widget_col' => $options['widget_col'], 'add_button_text' => $options['add_button_text'],
'button_col' => $options['button_col'] 'delete_button_text' => $options['delete_button_text'],
)); 'widget_col' => $options['widget_col'],
'button_col' => $options['button_col']
)
);
if ($form->getConfig()->hasAttribute('prototype')) { if ($form->getConfig()->hasAttribute('prototype')) {
$view->vars['prototype'] = $form->getConfig()->getAttribute('prototype')->createView($view); $view->vars['prototype'] = $form->getConfig()->getAttribute('prototype')->createView($view);
...@@ -55,9 +72,7 @@ class BootstrapCollectionType extends AbstractType ...@@ -55,9 +72,7 @@ class BootstrapCollectionType extends AbstractType
'options' => array(), 'options' => array(),
)); ));
$resolver->setNormalizers(array( $resolver->setNormalizers(array('options' => $optionsNormalizer));
'options' => $optionsNormalizer,
));
} }
/** /**
...@@ -75,4 +90,4 @@ class BootstrapCollectionType extends AbstractType ...@@ -75,4 +90,4 @@ class BootstrapCollectionType extends AbstractType
{ {
return 'bc_collection'; return 'bc_collection';
} }
} }
\ No newline at end of file
<?php <?php
/**
* This file is part of BcBootstrapBundle.
* (c) 2012-2013 by Florian Eckerstorfer
*/
namespace Bc\Bundle\BootstrapBundle\Form\Type; namespace Bc\Bundle\BootstrapBundle\Form\Type;
...@@ -10,6 +14,16 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedString ...@@ -10,6 +14,16 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\MoneyToLocalizedString
use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* MoneyType
*
* @package BcBootstrapBundle
* @subpackage Form
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2013 Florian Eckerstorfer
* @license http://opensource.org/licenses/MIT The MIT License
* @link http://bootstrap.braincrafted.com Bootstrap for Symfony2
*/
class MoneyType extends BaseMoneyType class MoneyType extends BaseMoneyType
{ {
/** /**
...@@ -33,6 +47,10 @@ class MoneyType extends BaseMoneyType ...@@ -33,6 +47,10 @@ class MoneyType extends BaseMoneyType
* *
* The pattern contains the placeholder "{{ widget }}" where the HTML tag should * The pattern contains the placeholder "{{ widget }}" where the HTML tag should
* be inserted * be inserted
*
* @param string $currency
*
* @return string Returns the pattern
*/ */
protected static function getPattern($currency) protected static function getPattern($currency)
{ {
...@@ -53,20 +71,33 @@ class MoneyType extends BaseMoneyType ...@@ -53,20 +71,33 @@ class MoneyType extends BaseMoneyType
// the spacings between currency symbol and number are ignored, because // the spacings between currency symbol and number are ignored, because
// a single space leads to better readability in combination with input // a single space leads to better readability in combination with input
// fields // fields
// the regex also considers non-break spaces (0xC2 or 0xA0 in UTF-8) // the regex also considers non-break spaces (0xC2 or 0xA0 in UTF-8)
preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches); preg_match('/^([^\s\xc2\xa0]*)[\s\xc2\xa0]*123(?:[,.]0+)?[\s\xc2\xa0]*([^\s\xc2\xa0]*)$/u', $pattern, $matches);
if (!empty($matches[1])) { self::$patterns[$locale][$currency] = self::parsePatternMatches($matches);
self::$patterns[$locale][$currency] = '{{ tag_start }}'.$matches[1].'{{ tag_end }} {{ widget }}';
} elseif (!empty($matches[2])) {
self::$patterns[$locale][$currency] = '{{ widget }} {{ tag_start }}'.$matches[2].'{{ tag_end }}';
} else {
self::$patterns[$locale][$currency] = '{{ widget }}';
}
} }
return self::$patterns[$locale][$currency]; return self::$patterns[$locale][$currency];
} }
/**
* Parses the given pattern matches array and returns the pattern string.
*
* @param array $matches Pattern matches
*
* @return string Pattern
*/
protected static function parsePatternMatches(array $matches)
{
if (!empty($matches[1])) {
return '{{ tag_start }}'.$matches[1].'{{ tag_end }} {{ widget }}';
}
if (!empty($matches[2])) {
return '{{ widget }} {{ tag_start }}'.$matches[2].'{{ tag_end }}';
}
return '{{ widget }}';
}
} }
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2012 Florian Eckerstorfer Copyright (c) 2012-2013 Florian Eckerstorfer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
......
<?php <?php
/**
* This file is part of BcBootstrapBundle.
* (c) 2012-2013 by Florian Eckerstorfer
*/
namespace Bc\Bundle\BootstrapBundle\Twig; namespace Bc\Bundle\BootstrapBundle\Twig;
...@@ -7,9 +11,14 @@ use Symfony\Bridge\Twig\Form\TwigRendererInterface; ...@@ -7,9 +11,14 @@ use Symfony\Bridge\Twig\Form\TwigRendererInterface;
use Symfony\Component\Form\Extension\Core\View\ChoiceView; use Symfony\Component\Form\Extension\Core\View\ChoiceView;
/** /**
* BootstrapFormExtension extends Twig with form capabilities. * BootstrapFormExtension
* *
* @author Florian Eckerstorfer <florian@eckerstorfer.co> * @package BcBootstrapBundle
* @subpackage Twig
* @author Florian Eckerstorfer <florian@eckerstorfer.co>
* @copyright 2012-2013 Florian Eckerstorfer
* @license http://opensource.org/licenses/MIT The MIT License
* @link http://bootstrap.braincrafted.com Bootstrap for Symfony2
*/ */
class BootstrapFormExtension extends \Twig_Extension class BootstrapFormExtension extends \Twig_Extension
{ {
...@@ -37,11 +46,21 @@ class BootstrapFormExtension extends \Twig_Extension ...@@ -37,11 +46,21 @@ class BootstrapFormExtension extends \Twig_Extension
return 'bootstrap_form'; return 'bootstrap_form';
} }
/**
* Sets the style.
*
* @param string $style Name of the style
*/
public function setStyle($style) public function setStyle($style)
{ {
$this->style = $style; $this->style = $style;
} }
/**
* Returns the style.
*
* @return string Name of the style
*/
public function getStyle() public function getStyle()
{ {
return $this->style; return $this->style;
......
<?php <?php
/** /**
* This file is part of BcBootstrapBundle. * This file is part of BcBootstrapBundle.
*
* (c) 2012-2013 by Florian Eckerstorfer * (c) 2012-2013 by Florian Eckerstorfer
*/ */
...@@ -13,7 +12,6 @@ use Twig_Filter_Method; ...@@ -13,7 +12,6 @@ use Twig_Filter_Method;
/** /**
* BootstrapIconExtension * BootstrapIconExtension
* *
* @category TwigExtension
* @package BcBootstrapBundle * @package BcBootstrapBundle
* @subpackage Twig * @subpackage Twig
* @author Florian Eckerstorfer <florian@eckerstorfer.co> * @author Florian Eckerstorfer <florian@eckerstorfer.co>
...@@ -58,6 +56,7 @@ class BootstrapIconExtension extends Twig_Extension ...@@ -58,6 +56,7 @@ class BootstrapIconExtension extends Twig_Extension
'/\.icon-([a-z0-9-]+)(\((white|black)\))?/', '/\.icon-([a-z0-9-]+)(\((white|black)\))?/',
function ($matches) use ($color, $that) { function ($matches) use ($color, $that) {
$color = isset($matches[3]) ? $matches[3] : $color; $color = isset($matches[3]) ? $matches[3] : $color;
return $that->iconFilter($matches[1], $color); return $that->iconFilter($matches[1], $color);
}, },
$text $text
......
{ {
"name": "braincrafted/bootstrap-bundle", "name": "braincrafted/bootstrap-bundle",
"version": "1.4.2",
"description": "Twitter Bootstrap for Symfony2", "description": "Twitter Bootstrap for Symfony2",
"keywords": ["bootstrap"], "keywords": ["bootstrap"],
"type": "symfony-bundle", "type": "symfony-bundle",
...@@ -31,7 +30,7 @@ ...@@ -31,7 +30,7 @@
"knplabs/knp-paginator-bundle": "BraincraftedBootstrapBundle styles the pagination provided by KnpPaginatorBundle.", "knplabs/knp-paginator-bundle": "BraincraftedBootstrapBundle styles the pagination provided by KnpPaginatorBundle.",
"knplabs/knp-menu": "Required to use KnpMenuBundle.", "knplabs/knp-menu": "Required to use KnpMenuBundle.",
"knplabs/knp-menu-bundle": "BraincraftedBootstrapBundle styles the menus provided by KnpMenuBundle.", "knplabs/knp-menu-bundle": "BraincraftedBootstrapBundle styles the menus provided by KnpMenuBundle.",
"twitter/bootstrap": "Twitter Bootstrap provides the assets (images, CSS and JS)" "twbs/bootstrap": "Twitter Bootstrap provides the assets (images, CSS and JS)"
}, },
"autoload": { "autoload": {
"psr-0": { "Bc\\Bundle\\BootstrapBundle": "" } "psr-0": { "Bc\\Bundle\\BootstrapBundle": "" }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment