Cutelyst  1.5.0
Public Member Functions | List of all members
Cutelyst::View Class Referenceabstract
Inheritance diagram for Cutelyst::View:
Inheritance graph

Public Member Functions

 View (QObject *parent, const QString &name=QString())
virtual Modifiers modifiers () const override
QString name () const
virtual QByteArray render (Context *c) const =0
- Public Member Functions inherited from Cutelyst::Component
 Component (QObject *parent=nullptr)
bool execute (Context *c)
virtual bool init (Application *application, const QVariantHash &args)
QString name () const
 name More...
QString reverse () const
 name More...
void setName (const QString &name)
void setReverse (const QString &reverse)

Additional Inherited Members

- Public Types inherited from Cutelyst::Component
enum  Modifier {
  None, OnlyExecute, BeforeExecute, AroundExecute,
- Protected Member Functions inherited from Cutelyst::Component
virtual bool afterExecute (Context *c)
void applyRoles (const QStack< Component * > &roles)
virtual bool aroundExecute (Context *c, QStack< Component * > stack)
virtual bool beforeExecute (Context *c)
virtual bool dispatcherReady (const Dispatcher *dispatch, Controller *controller)
- Protected Attributes inherited from Cutelyst::Component
ComponentPrivate * d_ptr

Detailed Description

Definition at line 31 of file view.h.

Member Function Documentation

virtual Modifiers Cutelyst::View::modifiers ( ) const

The default implementation returns Component::OnlyExecute

Reimplemented from Cutelyst::Component.

virtual QByteArray Cutelyst::View::render ( Context c) const
pure virtual

All subclasses must reimplement this when doing it's rendering. If an error (c->error()) is not set c->response()->body() is defined with the returned value, this is useful if the view is not meant to be used as a body.

Implemented in Cutelyst::ViewEmail, Cutelyst::ViewJson, Cutelyst::GrantleeView, Cutelyst::ViewEmailTemplate, and Cutelyst::ClearSilver.