Задать вопрос
  • Как заставить работать Yii2Assets/yii2-pdfjs?

    slo_nik
    @slo_nik Куратор тега Yii
    Вам для просмотра pdf файлов надо это установить?
    Или ещё нужна возможность скачивать эти файлы?
  • Как заставить работать Yii2Assets/yii2-pdfjs?

    slo_nik
    @slo_nik Куратор тега Yii
    ошибка в консоле браузера, что не может загрузить domain.com/assets/1b17959a/yii2-pdfjs.js

    Вот это надо в вопросе писать.
    Вдобавок показать код, как подключили, как настроили и как используете. И опять же, всё в вопросе.
  • Как заставить работать Yii2Assets/yii2-pdfjs?

    slo_nik
    @slo_nik Куратор тега Yii
    Добрый вечер.
    Как заставить его работать?

    И что именно не работает?
    Или предлагаете гадать на кофейной гуще?
  • Почему в модели не приходят данные из некоторых полей?

    slo_nik
    @slo_nik Куратор тега Yii
    lagoy, а зачем Вы в ответе на комментарий модель показываете?
  • Почему в модели не приходят данные из некоторых полей?

    slo_nik
    @slo_nik Куратор тега Yii
    lagoy, вид Вы показали, контроллер показали, а модель где?
  • "Кошерна" ли такая логика модели в Yii2?

    slo_nik
    @slo_nik Куратор тега Yii
    Но как тогда потом ее сохранить в базу опять в формате TIMESTAMP?

    Например при валидации.
    А дата рождения не должна хранится в таком формате

    Я Вам дал пример, дорабатывайте под свои нужды. Но гонять туда-сюда через formatter....
  • Как поставить слайдер на сайт?

    slo_nik
    @slo_nik
    Доброй ночи.
    У Вас jquery выдаёт ошибку.
    Ещё раз, внимательно, прочитайте инструкцию по установке слайдера на страницу и сделайте так, как в ней написано.
    Обратите внимание на порядок подключения css и js файлов.
  • Как побороть ошибку при установке yii2 через composer?

    slo_nik
    @slo_nik Куратор тега Yii
    yurygolikov, и опять Вы не правы)))
    Команда та же
    composer create-project --prefer-dist yiisoft/yii2-app-basic test_install

    Вывод консоли
    composer create-project --prefer-dist yiisoft/yii2-app-basic test_istall
    Installing yiisoft/yii2-app-basic (2.0.12)
    - Installing yiisoft/yii2-app-basic (2.0.12): Downloading (100%)
    Created project in test_istall
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 63 installs, 0 updates, 0 removals
    - Installing yiisoft/yii2-composer (2.0.5): Downloading (100%)
    - Installing swiftmailer/swiftmailer (v5.4.8): Downloading (100%)
    - Installing bower-asset/jquery (2.2.4): Downloading (100%)
    - Installing bower-asset/yii2-pjax (v2.0.7): Downloading (100%)
    - Installing bower-asset/punycode (v1.3.2): Downloading (100%)
    - Installing cebe/markdown (1.1.2): Downloading (100%)
    - Installing ezyang/htmlpurifier (v4.9.3): Downloading (100%)
    - Installing bower-asset/jquery.inputmask (3.3.9): Downloading (100%)
    - Installing yiisoft/yii2 (2.0.12): Downloading (100%)
    - Installing yiisoft/yii2-swiftmailer (2.0.7): Downloading (100%)
    - Installing bower-asset/bootstrap (v3.3.7): Downloading (100%)
    - Installing yiisoft/yii2-bootstrap (2.0.7): Downloading (100%)
    - Installing yiisoft/yii2-debug (2.0.12): Downloading (100%)
    - Installing bower-asset/typeahead.js (v0.11.1): Downloading (100%)
    - Installing phpspec/php-diff (v1.1.0): Downloading (100%)
    - Installing yiisoft/yii2-gii (2.0.5): Downloading (100%)
    - Installing fzaninotto/faker (v1.7.1): Downloading (100%)
    - Installing yiisoft/yii2-faker (2.0.3): Downloading (100%)
    - Installing psr/log (1.0.2): Downloading (100%)
    - Installing symfony/debug (v3.3.10): Downloading (100%)
    - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%)
    - Installing symfony/console (v3.3.10): Downloading (100%)
    - Installing stecman/symfony-console-completion (0.7.0): Downloading (100%)
    - Installing sebastian/diff (2.0.1): Downloading (100%)
    - Installing sebastian/recursion-context (3.0.0): Downloading (100%)
    - Installing sebastian/exporter (3.1.0): Downloading (100%)
    - Installing sebastian/comparator (2.0.2): Downloading (100%)
    - Installing behat/gherkin (v4.4.5): Downloading (100%)
    - Installing symfony/dom-crawler (v3.3.10): Downloading (100%)
    - Installing symfony/css-selector (v3.3.10): Downloading (100%)
    - Installing symfony/browser-kit (v3.3.10): Downloading (100%)
    - Installing symfony/yaml (v3.3.10): Downloading (100%)
    - Installing symfony/event-dispatcher (v3.3.10): Downloading (100%)
    - Installing symfony/finder (v3.3.10): Downloading (100%)
    - Installing psr/http-message (1.0.1): Downloading (100%)
    - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)
    - Installing doctrine/instantiator (1.0.5): Downloading (100%)
    - Installing phpunit/php-text-template (1.2.1): Downloading (100%)
    - Installing phpunit/phpunit-mock-objects (4.0.4): Downloading (100%)
    - Installing theseer/tokenizer (1.1.0): Downloading (100%)
    - Installing sebastian/version (2.0.1): Downloading (100%)
    - Installing sebastian/environment (3.1.0): Downloading (100%)
    - Installing sebastian/code-unit-reverse-lookup (1.0.1): Downloading (100%)
    - Installing phpunit/php-token-stream (2.0.1): Downloading (100%)
    - Installing phpunit/php-file-iterator (1.4.2): Downloading (100%)
    - Installing phpunit/php-code-coverage (5.2.2): Downloading (100%)
    - Installing sebastian/resource-operations (1.0.0): Downloading (100%)
    - Installing sebastian/object-reflector (1.1.1): Downloading (100%)
    - Installing sebastian/object-enumerator (3.0.3): Downloading (100%)
    - Installing sebastian/global-state (2.0.0): Downloading (100%)
    - Installing phpunit/php-timer (1.0.9): Downloading (100%)
    - Installing webmozart/assert (1.2.0): Downloading (100%)
    - Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)
    - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)
    - Installing phpdocumentor/reflection-docblock (4.1.1): Downloading (100%)
    - Installing phpspec/prophecy (v1.7.2): Downloading (100%)
    - Installing phar-io/version (1.0.1): Downloading (100%)
    - Installing phar-io/manifest (1.0.1): Downloading (100%)
    - Installing myclabs/deep-copy (1.6.1): Downloading (100%)
    - Installing phpunit/phpunit (6.4.1): Downloading (100%)
    - Installing codeception/base (2.3.6): Downloading (100%)
    - Installing codeception/verify (0.3.3): Downloading (100%)
    - Installing codeception/specify (0.4.6): Downloading (100%)
    symfony/console suggests installing symfony/filesystem ()
    symfony/console suggests installing symfony/process ()
    symfony/browser-kit suggests installing symfony/process ()
    symfony/event-dispatcher suggests installing symfony/dependency-injection ()
    symfony/event-dispatcher suggests installing symfony/http-kernel ()
    phpunit/phpunit-mock-objects suggests installing ext-soap (*)
    phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
    sebastian/global-state suggests installing ext-uopz (*)
    phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
    phpunit/phpunit suggests installing ext-xdebug (*)
    codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
    codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
    codeception/base suggests installing league/factory-muffin (For DataFactory module)
    codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
    codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
    Writing lock file
    Generating autoload files
    > yii\composer\Installer::postCreateProject
    chmod('runtime', 0777)...done.
    chmod('web/assets', 0777)...done.
    chmod('yii', 0755)...done.
  • Как обновить все записи в таблице?

    slo_nik
    @slo_nik Куратор тега Yii
    gachkydxvbgd, вот это всё требуется писать в вопрос!!!
    Исправляйте.
  • Как обновить все записи в таблице?

    slo_nik
    @slo_nik Куратор тега Yii
    Добрый вечер.
    Что умножит, что увеличить и что уменьшить?
    Конкретней пишите.
  • Нужно ли тут использовать dynamic model?

    slo_nik
    @slo_nik Куратор тега Yii
    lagoy, а как Вы использовали $model->getErrors()? Покажите.
  • Как побороть ошибку при установке yii2 через composer?

    slo_nik
    @slo_nik Куратор тега Yii
    yurygolikov, Вы не правы, только что проверил, всё работает на "ура".
    Команда
    composer create-project --prefer-dist yiisoft/yii2-app-basic test_install

    Вывод терминала

    composer create-project --prefer-dist yiisoft/yii2-app-basic test_istall
    Installing yiisoft/yii2-app-basic (2.0.12)
    - Installing yiisoft/yii2-app-basic (2.0.12): Loading from cache
    Created project in test_istall
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Package operations: 63 installs, 0 updates, 0 removals
    - Installing yiisoft/yii2-composer (2.0.5): Loading from cache
    - Installing swiftmailer/swiftmailer (v5.4.8): Loading from cache
    - Installing bower-asset/jquery (2.2.4): Loading from cache
    - Installing bower-asset/yii2-pjax (v2.0.7): Loading from cache
    - Installing bower-asset/punycode (v1.3.2): Loading from cache
    - Installing cebe/markdown (1.1.2): Loading from cache
    - Installing ezyang/htmlpurifier (v4.9.3): Loading from cache
    - Installing bower-asset/jquery.inputmask (3.3.9): Downloading (100%)
    - Installing yiisoft/yii2 (2.0.12): Loading from cache
    - Installing yiisoft/yii2-swiftmailer (2.0.7): Loading from cache
    - Installing bower-asset/bootstrap (v3.3.7): Loading from cache
    - Installing yiisoft/yii2-bootstrap (2.0.7): Loading from cache
    - Installing yiisoft/yii2-debug (2.0.12): Loading from cache
    - Installing bower-asset/typeahead.js (v0.11.1): Loading from cache
    - Installing phpspec/php-diff (v1.1.0): Loading from cache
    - Installing yiisoft/yii2-gii (2.0.5): Loading from cache
    - Installing fzaninotto/faker (v1.7.1): Loading from cache
    - Installing yiisoft/yii2-faker (2.0.3): Loading from cache
    - Installing psr/log (1.0.2): Loading from cache
    - Installing symfony/debug (v3.3.10): Loading from cache
    - Installing symfony/polyfill-mbstring (v1.5.0): Loading from cache
    - Installing symfony/console (v3.3.10): Loading from cache
    - Installing stecman/symfony-console-completion (0.7.0): Loading from cache
    - Installing sebastian/diff (2.0.1): Loading from cache
    - Installing sebastian/recursion-context (3.0.0): Loading from cache
    - Installing sebastian/exporter (3.1.0): Loading from cache
    - Installing sebastian/comparator (2.0.2): Loading from cache
    - Installing behat/gherkin (v4.4.5): Loading from cache
    - Installing symfony/dom-crawler (v3.3.10): Loading from cache
    - Installing symfony/css-selector (v3.3.10): Loading from cache
    - Installing symfony/browser-kit (v3.3.10): Loading from cache
    - Installing symfony/yaml (v3.3.10): Loading from cache
    - Installing symfony/event-dispatcher (v3.3.10): Loading from cache
    - Installing symfony/finder (v3.3.10): Loading from cache
    - Installing psr/http-message (1.0.1): Loading from cache
    - Installing guzzlehttp/psr7 (1.4.2): Loading from cache
    - Installing doctrine/instantiator (1.0.5): Loading from cache
    - Installing phpunit/php-text-template (1.2.1): Loading from cache
    - Installing phpunit/phpunit-mock-objects (4.0.4): Loading from cache
    - Installing theseer/tokenizer (1.1.0): Loading from cache
    - Installing sebastian/version (2.0.1): Loading from cache
    - Installing sebastian/environment (3.1.0): Loading from cache
    - Installing sebastian/code-unit-reverse-lookup (1.0.1): Loading from cache
    - Installing phpunit/php-token-stream (2.0.1): Loading from cache
    - Installing phpunit/php-file-iterator (1.4.2): Loading from cache
    - Installing phpunit/php-code-coverage (5.2.2): Loading from cache
    - Installing sebastian/resource-operations (1.0.0): Loading from cache
    - Installing sebastian/object-reflector (1.1.1): Loading from cache
    - Installing sebastian/object-enumerator (3.0.3): Loading from cache
    - Installing sebastian/global-state (2.0.0): Loading from cache
    - Installing phpunit/php-timer (1.0.9): Loading from cache
    - Installing webmozart/assert (1.2.0): Loading from cache
    - Installing phpdocumentor/reflection-common (1.0.1): Loading from cache
    - Installing phpdocumentor/type-resolver (0.4.0): Loading from cache
    - Installing phpdocumentor/reflection-docblock (4.1.1): Loading from cache
    - Installing phpspec/prophecy (v1.7.2): Loading from cache
    - Installing phar-io/version (1.0.1): Loading from cache
    - Installing phar-io/manifest (1.0.1): Loading from cache
    - Installing myclabs/deep-copy (1.6.1): Loading from cache
    - Installing phpunit/phpunit (6.4.1): Loading from cache
    - Installing codeception/base (2.3.6): Loading from cache
    - Installing codeception/verify (0.3.3): Loading from cache
    - Installing codeception/specify (0.4.6): Loading from cache
    symfony/console suggests installing symfony/filesystem ()
    symfony/console suggests installing symfony/process ()
    symfony/browser-kit suggests installing symfony/process ()
    symfony/event-dispatcher suggests installing symfony/dependency-injection ()
    symfony/event-dispatcher suggests installing symfony/http-kernel ()
    phpunit/phpunit-mock-objects suggests installing ext-soap (*)
    phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
    sebastian/global-state suggests installing ext-uopz (*)
    phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
    phpunit/phpunit suggests installing ext-xdebug (*)
    codeception/base suggests installing flow/jsonpath (For using JSONPath in REST module)
    codeception/base suggests installing phpseclib/phpseclib (for SFTP option in FTP Module)
    codeception/base suggests installing league/factory-muffin (For DataFactory module)
    codeception/base suggests installing league/factory-muffin-faker (For Faker support in DataFactory module)
    codeception/base suggests installing symfony/phpunit-bridge (For phpunit-bridge support)
    Writing lock file
    Generating autoload files
    > yii\composer\Installer::postCreateProject
    chmod('runtime', 0777)...done.
    chmod('web/assets', 0777)...done.
    chmod('yii', 0755)...done.
  • Нужно ли тут использовать dynamic model?

    slo_nik
    @slo_nik Куратор тега Yii
    lagoy, в действии контроллера сделайте вызов $model->getErrors() и смотрите, есть ошибки или нет.
  • Как побороть ошибку при установке yii2 через composer?

    slo_nik
    @slo_nik Куратор тега Yii
    Сергей Бурдужа, достаточно было бы использовать такую команду
    composer create-project --prefer-dist yiisoft/yii2-app-basic

    без указания версии.
    Если потребуется, то ещё надо указать имя директории, в которую надо установить framework.
    И конечно же использовать или плагин asset-plugin или asset-packagist
  • Как устранить проблему с установкой пакетов в yii2?

    slo_nik
    @slo_nik Куратор тега Yii
    Добрый день.
    Прочитайте в конце, "потенциальные причины".
    Potential causes:
    - A typo in the package name
    - The package is not available in a stable-enough version according to your minimum-stability setting
    see for more details.

    Есть ссылка https://getcomposer.org/doc/04-schema.md#minimum-s... читайте, что там написано.
  • Вставить в Yii2 стороннюю PHP функцию?

    slo_nik
    @slo_nik Куратор тега Yii
    Lander, тем более, что если не будет описана валидация - форма не будет нормально работать.
  • Вставить в Yii2 стороннюю PHP функцию?

    slo_nik
    @slo_nik Куратор тега Yii
    Lander, допустим, что у автора вопроса это получится, просто вставить свой код. А потом как его отладить, как отлавливать ошибки?
    И вообще...
    После того, как он его просто воткнёт в yii2 начнётся масса вопросов типа "Форма не работает, что делать? Хелп!!!"
  • Вставить в Yii2 стороннюю PHP функцию?

    slo_nik
    @slo_nik Куратор тега Yii
    Lander, ну require и include никто не отменял... Но всё равно, действие в контроллере надо описывать, да и валидировать надо ещё.
  • Как применить нужную миграцию yii migrate/to?

    slo_nik
    @slo_nik Куратор тега Yii
    akula22, экранируйте скобки
    php yii migrate/create drop_post_table --fields=title:string\(12\):notNull:unique,body:text