atm / inboxbundle
1.0.35
2021-05-27 13:17 UTC
Requires
- php: >=5.3.9
Requires (Dev)
Suggests
- symfony/asset: For using the AssetExtension
- symfony/expression-language: For using the ExpressionExtension
- symfony/finder: For using the finder
- symfony/form: For using the FormExtension
- symfony/http-kernel: For using the HttpKernelExtension
- symfony/routing: For using the RoutingExtension
- symfony/security: For using the SecurityExtension
- symfony/stopwatch: For using the StopwatchExtension
- symfony/templating: For using the TwigEngine
- symfony/translation: For using the TranslationExtension
- symfony/var-dumper: For using the DumpExtension
- symfony/yaml: For using the YamlExtension
This package is auto-updated.
Last update: 2024-09-27 20:08:58 UTC
README
邮箱管理系统
安装
通过composer安装
php -d memory_limit=-1 composer.phar require atm/inboxbundle
在AppKernel中
public function registerbundles()
{
return [
...
...
new ATM\InboxBundle\ATMInboxBundle(),
];
}
路由
追加到主路由文件
# app/config/routing.yml
atm_inbox:
resource: "@ATMInboxBundle/Resources/config/routing.yml"
prefix: /
配置示例
以下显示默认值
# app/config/config.yml
atm_inbox:
class:
model:
conversation: Your conversation class namespace
conversation_message: Your conversation message namespace
message: Your message namespace
user: Your User namespace
类继承
为了使用ATMInboxBundle的类,您需要创建自己的Conversation、ConversationMessage和Message类,这些类将扩展ATMInboxBundle中的Conversation、ConversationMessage和Message抽象类,如下所示
namespace CoreBundle\Entity;
use ATM\InboxBundle\Entity\Conversation as BaseConversation;
class Conversation extends BaseConversation{}
namespace CoreBundle\Entity;
use ATM\InboxBundle\Entity\ConversationMessage as BaseConversationMessage;
class ConversationMessage extends BaseConversationMessage{}
namespace CoreBundle\Entity;
use ATM\InboxBundle\Entity\Message as BaseMessage;
class ConversationMessage extends BaseConversationMessage{}
Twig扩展
您可以使用以下twig扩展来了解用户有多少未读消息
{{ getUnreadMessages(app.user.id) }}