Abstract Class Socialveo\Frontend\controllers\FrontendController

InheritanceSocialveo\Frontend\controllers\FrontendController » Phalcon\Mvc\Controller
Uses TraitsSocialveo\Core\Translatable
SubclassesSocialveo\Frontend\controllers\AuthController, Socialveo\Frontend\controllers\ChatController, Socialveo\Frontend\controllers\CircleController, Socialveo\Frontend\controllers\CommentsController, Socialveo\Frontend\controllers\ConnectionsController, Socialveo\Frontend\controllers\IframeController, Socialveo\Frontend\controllers\IndexController, Socialveo\Frontend\controllers\MapsController, Socialveo\Frontend\controllers\MediaController, Socialveo\Frontend\controllers\NetworksController, Socialveo\Frontend\controllers\PostsController, Socialveo\Frontend\controllers\SearchController, Socialveo\Frontend\controllers\StaticPagesController, Socialveo\Frontend\controllers\UsersController, Socialveo\Frontend\controllers\api\JsonController, Socialveo\Frontend\controllers\api\MapsController, Socialveo\Frontend\controllers\api\NotificationsController, Socialveo\Frontend\controllers\api\SocketController, Socialveo\Frontend\controllers\api\TranslatorController, Socialveo\Frontend\controllers\payments\PayPalController, Socialveo\Frontend\controllers\payments\StripeController, Socialveo\Frontend\controllers\users\BlocksController, Socialveo\Frontend\controllers\users\FollowController

Class FrontendController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
_t() Gets translations Socialveo\Core\Translatable
afterExecuteRoute() Socialveo\Frontend\controllers\FrontendController
beforeExecuteRoute() Before execute route Socialveo\Frontend\controllers\FrontendController
fire() Fire custom event Socialveo\Frontend\controllers\FrontendController
getEmbed() Embed getter method, if embed property is not set, fetches embed from request URL Socialveo\Frontend\controllers\FrontendController
getIsRequestPjax() Checks whether is requested via jquery.pjax Socialveo\Frontend\controllers\FrontendController
getLanguage() Gets language code Socialveo\Frontend\controllers\FrontendController
getParams() Gets $_REQUEST superglobal Socialveo\Frontend\controllers\FrontendController
getRequired() Get required param / params Socialveo\Frontend\controllers\FrontendController
getRequiredQuery() Get required param / params from $_GET Socialveo\Frontend\controllers\FrontendController
initialize() Initialize controller Socialveo\Frontend\controllers\FrontendController
notFound() Not found action Socialveo\Frontend\controllers\FrontendController
partialRender() Renders partial view without layout Socialveo\Frontend\controllers\FrontendController
pick() Pick view Socialveo\Frontend\controllers\FrontendController
posts() Find posts and attach to page Socialveo\Frontend\controllers\FrontendController
setDebugHeaders() Sets headers for debug XHR Socialveo\Frontend\controllers\FrontendController
setHttpCode() Set response Http code Socialveo\Frontend\controllers\FrontendController
t() Gets translations Socialveo\Core\Translatable

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkAccess() Checks during the init of controller whether user is a guest. Socialveo\Frontend\controllers\FrontendController
checkIsAjax() Checks whether request is AJAX, redirect if false Usage in action: if (!$this->checkIsAjax()) { return false; } Socialveo\Frontend\controllers\FrontendController
getSocketData() Returns socket events Socialveo\Frontend\controllers\FrontendController
getTranslation() Gets translations Socialveo\Frontend\controllers\FrontendController
initAssets() Initialize assets Socialveo\Frontend\controllers\FrontendController
initViewVars() Sets view vars. Socialveo\Frontend\controllers\FrontendController
redirect() Redirect to url Socialveo\Frontend\controllers\FrontendController
reload() Reload the page Socialveo\Frontend\controllers\FrontendController
renderDefault() Render default page Socialveo\Frontend\controllers\FrontendController
respondWithArray() Returns an error response with an array Socialveo\Frontend\controllers\FrontendController
respondWithItem() Returns a response with a single item Socialveo\Frontend\controllers\FrontendController
respondWithStatus() Returns a response with status and message Socialveo\Frontend\controllers\FrontendController
responseError() Respond with error Socialveo\Frontend\controllers\FrontendController
responseJson() Response json Socialveo\Frontend\controllers\FrontendController
responseSuccess() Respond with success Socialveo\Frontend\controllers\FrontendController

Property Details

$mail protected property
$network protected property
$params protected property
protected array $params = []
$pickView protected property
protected string $pickView null
$postNetworkUuid protected property
protected string $postNetworkUuid null
$profileUser protected property
$responseTypeJson protected property
protected boolean $responseTypeJson false

Method Details

afterExecuteRoute() public method

public void afterExecuteRoute ( $dispatcher )
$dispatcher Phalcon\Dispatcher
beforeExecuteRoute() public method

Before execute route

public boolean beforeExecuteRoute ( $dispatcher )
$dispatcher Socialveo\Core\Dispatcher
checkAccess() protected method

Checks during the init of controller whether user is a guest.

Override this method to allow guests access to actions of the specific controller, like in AuthController

protected boolean|mixed checkAccess ( )
checkIsAjax() protected method

Checks whether request is AJAX, redirect if false Usage in action: if (!$this->checkIsAjax()) { return false; }

protected boolean checkIsAjax ( )
fire() public method

Fire custom event

public void fire ( $event, array $options = [] )
$event string
$options array

[optional]

getEmbed() public method (available since version 1.0)

Embed getter method, if embed property is not set, fetches embed from request URL

public array getEmbed ( )
return array

$params

getIsRequestPjax() public method

Checks whether is requested via jquery.pjax

public boolean getIsRequestPjax ( )
getLanguage() public method

Gets language code

public string getLanguage ( )
getParams() public method

Gets $_REQUEST superglobal

public array getParams ( )
getRequired() public method

Get required param / params

public mixed getRequired ( $name, $filters null, $defaultValue null )
$name string
$filters mixed

[optional]

$defaultValue mixed

[optional]

throws Exception
getRequiredQuery() public method

Get required param / params from $_GET

public mixed getRequiredQuery ( $name, $filters null, $defaultValue null )
$name string
$filters mixed

[optional]

$defaultValue mixed

[optional]

throws Exception
getSocketData() protected method

Returns socket events

protected void getSocketData ( )
getTranslation() protected method

Gets translations

protected Socialveo\Core\library\Gettext getTranslation ( )
initAssets() protected method

Initialize assets

protected void initAssets ( )
throws ErrorException
initViewVars() protected method

Sets view vars.

If $vars is null - sets all vars If $vars is empty array - sets only default vars If $vars is not empty array - sets defaults + values as variables name

protected void initViewVars ( $vars null )
$vars array|null
initialize() public method

Initialize controller

public void initialize ( )
notFound() public method

Not found action

public void notFound ( $statusCode 404, $statusText 'NotFound' )
$statusCode integer
$statusText string
partialRender() public method

Renders partial view without layout

public string partialRender ( $template, $params = [], $initViewVars true )
$template string

View location

$params array

[optional] View params

$initViewVars boolean

[optional] Whatever is init view vars

return string

Html content

pick() public method

Pick view

public void pick ( $view )
$view string
posts() public method

Find posts and attach to page

public Phalcon\Http\Response|Phalcon\Http\ResponseInterface posts ( $networks null, $currentPage, Phalcon\Mvc\Model\Criteria $criteria null, $ignoreActive false, $ignoreStatus false )
$networks array|Socialveo\Core\models\Network|null
$currentPage integer
$criteria Phalcon\Mvc\Model\Criteria

[optional]

$ignoreActive boolean

[optional]

$ignoreStatus boolean

[optional]

redirect() protected method

Redirect to url

protected Phalcon\Http\Response|Phalcon\Http\ResponseInterface redirect ( $url '/' )
$url string
reload() protected method

Reload the page

protected Phalcon\Http\Response|Phalcon\Http\ResponseInterface reload ( $data = [] )
$data array

[optional]

renderDefault() protected method

Render default page

protected void renderDefault ( )
respondWithArray() protected method (available since version 1.0)

Returns an error response with an array

protected Phalcon\Http\Response respondWithArray ( $array )
$array array
return Phalcon\Http\Response

Object

throws Exception
respondWithItem() protected method (available since version 1.0)

Returns a response with a single item

protected array respondWithItem ( &$object )
$object mixed|Socialveo\Core\models\SocialveoModel
return array

Response

respondWithStatus() protected method (available since version 1.0)

Returns a response with status and message

protected array respondWithStatus ( $status, $message null, array $data = [] )
$status string
$message string
$data array
return array

Response

responseError() protected method (available since version 1.0)

Respond with error

protected Phalcon\Http\Response|Phalcon\Http\ResponseInterface responseError ( $data = [] )
$data array|string
responseJson() protected method

Response json

protected void responseJson ( $data = [], $excludeSocket false )
$data array
$excludeSocket boolean

[optional]

responseSuccess() protected method (available since version 1.0)

Respond with success

protected Phalcon\Http\Response|Phalcon\Http\ResponseInterface responseSuccess ( $data = [] )
$data array|string
setDebugHeaders() public method

Sets headers for debug XHR

public void setDebugHeaders ( $headers )
$headers array

TODO: remove on production

setHttpCode() public method (available since version 1.0)

Set response Http code

public void setHttpCode ( $code, $message '' )
$code integer

The http code

$message string

The http message