Class app\controllers\PostsController

Inheritanceapp\controllers\PostsController » yii\web\Controller

Clase PostsController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
actionAceptar() Acepta aquellos posts que estan en moderación app\controllers\PostsController
actionDelete() Deletes an existing Post model. app\controllers\PostsController
actionGenerador() Acción para el generador de posts el cual obtiene la ruta de todas las imagenes y se las manda a la vista app\controllers\PostsController
actionGeneradorCrear() Cuando se selecciona una imagen con la que generar un meme se le pasara dicho fichero a la vista generador-crear app\controllers\PostsController
actionIndex() List all Post models app\controllers\PostsController
actionModerar() Lists all Post models that need moderation. app\controllers\PostsController
actionRechazar() Rechaza aquellos posts que estan en moderación app\controllers\PostsController
actionSearch() Realiza la busqueda por titulo de los Posts app\controllers\PostsController
actionSearchAjax() Acción que lleva a cabo la busqueda del post por titulo mediante ajax app\controllers\PostsController
actionUpdate() Updates an existing Post model. app\controllers\PostsController
actionUpload() Creates a new Post model. app\controllers\PostsController
actionView() Displays a single Post model. app\controllers\PostsController
actionVotar() Realiza la votación de un post app\controllers\PostsController
behaviors() app\controllers\PostsController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
findModel() Finds the Post model based on its primary key value. app\controllers\PostsController

Method Details

actionAceptar() public method

Acepta aquellos posts que estan en moderación

public mixed actionAceptar ( $id )
$id integer

Id del post a aceptar

actionDelete() public method

Deletes an existing Post model.

If deletion is successful, the browser will be redirected to the 'index' page.

public mixed actionDelete ( $id )
$id integer
actionGenerador() public method

Acción para el generador de posts el cual obtiene la ruta de todas las imagenes y se las manda a la vista

public mixed actionGenerador ( )
actionGeneradorCrear() public method

Cuando se selecciona una imagen con la que generar un meme se le pasara dicho fichero a la vista generador-crear

public mixed actionGeneradorCrear ( $fichero )
$fichero string

Nombre del fichero

actionIndex() public method

List all Post models

public mixed actionIndex ( $categoria null )
$categoria string

Categoria a buscar

actionModerar() public method

Lists all Post models that need moderation.

public mixed actionModerar ( )
actionRechazar() public method

Rechaza aquellos posts que estan en moderación

public mixed actionRechazar ( $id )
$id integer

Id del post a aceptar

actionSearch() public method

Realiza la busqueda por titulo de los Posts

public mixed actionSearch ( $q null )
$q string

La cadena que correspondera con la busqueda del titulo

actionSearchAjax() public method

Acción que lleva a cabo la busqueda del post por titulo mediante ajax

public mixed actionSearchAjax ( $q null )
$q string

Cadena a buscar titulo

actionUpdate() public method

Updates an existing Post model.

If update is successful, the browser will be redirected to the 'view' page.

public mixed actionUpdate ( $id )
$id integer
actionUpload() public method

Creates a new Post model.

If creation is successful, the browser will be redirected to the 'view' page.

public mixed actionUpload ( )
actionView() public method

Displays a single Post model.

public mixed actionView ( $id )
$id integer
actionVotar() public method

Realiza la votación de un post

public integer actionVotar ( $id, $positivo )
$id integer

Id del post

$positivo boolean

Si es o no positivo

return integer

Numero total de votos (resta positivos - negativos)

behaviors() public method

public void behaviors ( )
findModel() protected method

Finds the Post model based on its primary key value.

If the model is not found, a 404 HTTP exception will be thrown.

protected app\models\Post findModel ( $id )
$id integer
return app\models\Post

The loaded model

throws \yii\web\NotFoundHttpException

if the model cannot be found