Rename all the files to camelCase and update the class name in the files
This commit is contained in:
40
src/Outputrest.php
Normal file
40
src/Outputrest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/** DomFramework
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
|
||||
namespace Domframework;
|
||||
|
||||
/** Display in REST the data provided.
|
||||
* Allow all the output types : JSON, XML, TXT...
|
||||
*/
|
||||
class Outputrest extends Output
|
||||
{
|
||||
/** Data is printed by viewClass->viewmethod, in the middle of $layout
|
||||
* title is put in the title of the HTML page
|
||||
* $replacement modify the result (it can do title too :
|
||||
* array ("{title}"=>"title to display")
|
||||
* @param mixed $data Data to display on the page
|
||||
* @param string|null $title Title to put on head of page
|
||||
* @param string|null $viewClass Class in views to use to display
|
||||
* @param string|null $viewMethod Method in the class in views
|
||||
* @param string|null $layout Layout file in views
|
||||
* @param array|null $replacement Replace the {key}=>value
|
||||
* @param array|null $variable PHP variables send to the view and to layout
|
||||
* (can be processed by foreach, if...)
|
||||
* @param string|null $module The module name to use if needed
|
||||
* @return Exit from PHP at the end of HTML display
|
||||
*/
|
||||
public function out ($data, $title = FALSE,
|
||||
$viewClass = FALSE, $viewMethod = FALSE,
|
||||
$layout = FALSE, $replacement = array(),
|
||||
$variable = array (), $module = "")
|
||||
{
|
||||
if (! isset ($variable["exceptionCode"]))
|
||||
$variable["exceptionCode"] = 200;
|
||||
$rest = new rest ();
|
||||
$rest->display ($data, $variable["exceptionCode"]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user