PHP Classes

File: templates/error

Recommend this page to a friend!
  Classes of Isaac Trenado Mx   Dropsize MVCf   templates/error   Download  
File: templates/error
Role: Auxiliary script
Content type: text/plain
Description: Template show error
Class: Dropsize MVCf
Base MVC framework that extends the Slim framework
Author: By
Last change:
Date: 8 years ago
Size: 2,201 bytes
 

Contents

Class file image Download
<?php
/**
 * DropsizeMVCf - extension of the SlimFramework and others tools
 *
 * @author Isaac Trenado <isaac.trenado@codigolimpio.com>
 * @copyright 2013 Isaac Trenado
 * @link http://dropsize.codigolimpio.com
 * @license http://dropsize.codigolimpio.com/license.txt
 * @version 3.0.1
 * @package DropsizeMVCf
 *
 * DropsizeMVCf - Web publishing software
 * Copyright 2015 by the contributors
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 * This program incorporates work covered by the following copyright and
 * permission notices:
 *
 * DropsizeMVCf is (c) 2013, 2015
 * Isaac Trenado - isaac.trenado@codigolimpio.com -
 * http://www.codigolimpio.com
 *
 * Wherever third party code has been used, credit has been given in the code's comments.
 *
 * DropsizeMVCf is released under the GPL
 *
 */

/**
 * Slimframework template
 *
 * @package com.dropsizemvcf.templates.error
 * @author Isaac Trenado
 * @since 1.0.0
 *
 *
 */

defined('_DSEXEC') or die;

$app = Slim::getInstance();
$req = $app->request();
$res = $app->response();
$err = $e->getTrace();

if (
$req->isAjax()) {
   
// Armamos la respuesta en json
   
echo json_encode(
            array(
"success" => 0, "code" => $e->getCode()
                ,
"estatus" => $res->status()
                ,
"mensaje" => $e->getMessage()
                ,
"trace" => $err[0]
            )
    );
} else {
    echo
json_encode(array($e->getMessage(), $err[0]));
}