2017 © Pedro Peláez
 

library messages

Message Alert

image

parishop/messages

Message Alert

  • Monday, December 5, 2016
  • by Parishop
  • Repository
  • 0 Watchers
  • 2 Stars
  • 36 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Messages

Уведомления для PHPixie 3, (*1)

Данная библиотека позволяет выводить уведомления в шаблоне, (*2)

Установка

1 Подключаем библиотеку, (*3)

composer require parishop/messages:~1.0

2 Добавляем расширение для шаблона, (*4)

// /src/Project/Framework/Extensions.php
    public function templateExtensions()
    {
        return array_merge(
            parent::templateExtensions(), array(
                new \Parishop\Messages($this->builder->context()->httpContext()),
            )
        );
    }

3 Добавляем расширение в проект, (*5)

// /bundles/app/src/Project/App/Builder.php
    /**
     * @return \Parishop\Messages
     */
    public function messages()
    {
        return $this->components()->template->builder()->extensions()->get('messages');
    }

Использование

В Процессоре

Доступны все методы класса \Psr\Log\LoggerTrait для всех уровней класса \Psr\Log\LogLevel, (*6)

  1. LogLevel::EMERGENCY php $this->builder->messages()->emergency($message, array $context = array()), (*7)

  2. LogLevel::ALERT php $this->builder->messages()->alert($message, array $context = array()), (*8)

  3. LogLevel::CRITICAL php $this->builder->messages()->critical($message, array $context = array()), (*9)

  4. LogLevel::ERROR php $this->builder->messages()->error($message, array $context = array()), (*10)

  5. LogLevel::WARNING php $this->builder->messages()->warning($message, array $context = array()), (*11)

  6. LogLevel::NOTICE php $this->builder->messages()->notice($message, array $context = array()), (*12)

  7. LogLevel::INFO php $this->builder->messages()->info($message, array $context = array()), (*13)

  8. LogLevel::DEBUG php $this->builder->messages()->debug($message, array $context = array()), (*14)

  9. Отдельный уровень danger php $this->builder->messages()->danger($message, array $context = array()), (*15)

  10. А так же общий метод с любым уровнем php $this->builder->messages()->log($level, $message, array $context = array()), (*16)

В Шаблоне

<?php foreach($this->messages() as $message){ ?>
    <div class="alert alert-<?= $message->level(); ?>">
        <?= $message; ?>
    </div>
<?php } ?>

The Versions

05/12 2016

dev-master

9999999-dev

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling

05/12 2016

1.0.3

1.0.3.0

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling

24/11 2016

1.0.2

1.0.2.0

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling

24/11 2016

1.0.1

1.0.1.0

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling

24/11 2016

dev-hotfix/1.0.1

dev-hotfix/1.0.1

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling

15/11 2016

1.0

1.0.0.0

Message Alert

  Sources   Download

MIT

The Requires

 

by Vadim Meling