четверг, 18 августа 2016 г.

symfony fixtures cannot delete or update a parent row

* you can add to problem entity field, which is described in error onDelete="set null"

* or deny to purge your database, add to your command key --append.

четверг, 11 августа 2016 г.

Unable to find mapping information for the class Context

Need to fully configure sonata-classification-bundle, its needed for modern versions of sonata-media.

четверг, 14 июля 2016 г.

5 columns layout with Twitter Bootstrap

based on http://www.wearesicc.com/quick-tips-5-column-layout-with-twitter-bootstrap/ , modified for fitting 5 columns in any >320px width displays.

.col-xs-15,
.col-sm-15,
.col-md-15,
.col-lg-15 {
  position: relative;
  min-height: 1px;
  padding-right: 10px;
  padding-left: 10px;
}

@media (min-width: 320px) {
  .col-md-15 {
    width: 20%;
    float: left;
  }
}

And use it like this:
<div class="col-md-15 col-sm-3">
    ...
</div>

понедельник, 11 июля 2016 г.

how to fix Symfony CSRF token is invalid. Please try to resubmit the form

If you have problems with uploading files, you should not disable  CSRF, only fix it with this hints:

* make sure in php.ini (in all directories in /etc/php5/) max_post_size much bigger than upload_size.
* do not forget to restart server (apache or nginx) and "service php5-fpm restart"

среда, 6 июля 2016 г.

How to add radiobuttons field in Sonata-Admin

protected function configureFormFields(FormMapper $formMapper) {
$formMapper
->add('lang', 'choice', [    'expanded' => true,    'choices' => [    '0' => 'LV',    '1' => 'RU',    '2' => 'EN'        ]]);
}

how to fix \ValidateRequestListener' not found in \ContainerAwareEventDispatcher.php

Just delete cache folder in /app/cache/prod or dev.