MVCFactory
Implements MVCFactoryInterface, FormFactoryAwareInterface, SiteRouterAwareInterface, UserFactoryAwareInterface, MailerFactoryAwareInterfaceFactory to create MVC objects based on a namespace.
| since |
3.10.0 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
The namespace must be like: Joomla\Component\Content
__construct( namespace, \Psr\Log\LoggerInterface logger = null) :
| since |
4.0.0 |
|---|
Arguments
- namespace
stringThe namespace- logger
LoggerInterface|nullA logging instance to inject into the controller if required
Response
mixed
createController
Method to load and return a controller object.
createController( name, prefix, mixed||string|int config, \Joomla\CMS\Application\CMSApplicationInterface app, \Joomla\Input\Input input) : \Joomla\CMS\MVC\Controller\ControllerInterface|null
| since |
3.10.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe name of the controller- prefix
stringThe controller prefix- config
array<string|int, mixed>The configuration array for the controller- app
CMSApplicationInterfaceThe app- input
InputThe input
Response
ControllerInterface|null
createModel
Method to load and return a model object.
createModel( name, prefix = '', mixed||string|int config = []) : \Joomla\CMS\MVC\Model\ModelInterface
| since |
3.10.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe name of the model.- prefix
stringOptional model prefix.- config
array<string|int, mixed>Optional configuration array for the model.
Response
ModelInterfaceThe model object
createTable
Method to load and return a table object.
createTable( name, prefix = '', mixed||string|int config = []) : \Joomla\CMS\Table\Table
| since |
3.10.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe name of the table.- prefix
stringOptional table prefix.- config
array<string|int, mixed>Optional configuration array for the table.
Response
TableThe table object
createView
Method to load and return a view object.
createView( name, prefix = '', type = '', mixed||string|int config = []) : \Joomla\CMS\MVC\View\ViewInterface
| since |
3.10.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe name of the view.- prefix
stringOptional view prefix.- type
stringOptional type of view.- config
array<string|int, mixed>Optional configuration array for the view.
Response
ViewInterfaceThe view object
getCacheControllerFactory
Get the CacheControllerFactoryInterface.
getCacheControllerFactory() : \Joomla\CMS\Cache\CacheControllerFactoryInterface
getClassName
Returns a standard classname, if the class doesn't exist null is returned.
getClassName( suffix, prefix) : string|null
| since |
3.10.0 |
|---|
Arguments
- suffix
stringThe suffix- prefix
stringThe prefix
Response
string|nullThe class name
getFormFactory
Get the FormFactoryInterface.
getFormFactory() : \Joomla\CMS\Form\FormFactoryInterface
| since |
4.0.0 |
|---|---|
| throws |
|
Response
getMailerFactory
Get the MailerFactoryInterface.
getMailerFactory() : \Joomla\CMS\Mail\MailerFactoryInterface
| since |
4.4.0 |
|---|---|
| throws |
|
Response
getSiteRouter
Get the site router.
getSiteRouter() : \Joomla\CMS\Router\SiteRouter
| since |
4.2.0 |
|---|---|
| throws |
|
Response
getUserFactory
Get the UserFactoryInterface.
getUserFactory() : \Joomla\CMS\User\UserFactoryInterface
| since |
4.4.0 |
|---|---|
| throws |
|
Response
setCacheControllerFactory
Set the cache controller factory to use.
setCacheControllerFactory(\Joomla\CMS\Cache\CacheControllerFactoryInterface cacheControllerFactory = null) :
| since |
4.2.0 |
|---|
Arguments
- cacheControllerFactory
CacheControllerFactoryInterface|nullThe cache controller factory to use.
Response
void
setCacheControllerOnObject
Sets the internal cache controller on the given object.
setCacheControllerOnObject( object) :
| since |
4.2.0 |
|---|
Arguments
- object
objectThe object
Response
void
setDispatcherOnObject
Sets the internal event dispatcher on the given object.
setDispatcherOnObject( object) :
| since |
4.2.0 |
|---|
Arguments
- object
objectThe object
Response
void
setFormFactory
Set the form factory to use.
setFormFactory(\Joomla\CMS\Form\FormFactoryInterface formFactory = null) :
setFormFactoryOnObject
Sets the internal form factory on the given object.
setFormFactoryOnObject( object) :
| since |
4.0.0 |
|---|
Arguments
- object
objectThe object
Response
void
setMailerFactory
Set the mailer factory to use.
setMailerFactory(\Joomla\CMS\Mail\MailerFactoryInterface mailerFactory = null) :
| since |
4.4.0 |
|---|
Arguments
- mailerFactory
MailerFactoryInterface|nullThe mailer factory to use.
Response
void
setMailerFactoryOnObject
Sets the internal mailer factory on the given object.
setMailerFactoryOnObject( object) :
| since |
4.4.0 |
|---|
Arguments
- object
objectThe object
Response
void
setRouterOnObject
Sets the internal router on the given object.
setRouterOnObject( object) :
| since |
4.2.0 |
|---|
Arguments
- object
objectThe object
Response
void
setSiteRouter
Set the router to use.
setSiteRouter(\Joomla\CMS\Router\SiteRouter router) :
setUserFactory
Set the user factory to use.
setUserFactory(\Joomla\CMS\User\UserFactoryInterface userFactory) :
setUserFactoryOnObject
Sets the internal user factory on the given object.
setUserFactoryOnObject( object) :
| since |
4.4.0 |
|---|
Arguments
- object
objectThe object
Response
void
Properties
cacheControllerFactory
CacheControllerFactoryInterface
namespace
The namespace to create the objects from.
| since |
4.0.0 |
|---|
Type(s)
string
logger
The namespace to create the objects from.
| since |
4.0.0 |
|---|
Type(s)
LoggerInterface