本文整理汇总了PHP中request::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP request::getInstance方法的具体用法?PHP request::getInstance怎么用?PHP request::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validatCreate
public static function validatCreate($nombre, $apellidos, $cedula, $direccion, $telefono)
{
$flag = FALSE;
$patron = "^[a-zA-Z0-9]{3,20}\$";
if (!ereg($patron, $nombre)) {
session::getInstance()->setError('campo nombre no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::NOMBRE, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('datos', 'insert');
}
if (!ereg($patron, $apellidos)) {
session::getInstance()->setError('campo apellidos no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::APELLIDOS, true), true);
}
if (!ereg($patron, $cedula)) {
session::getInstance()->setError('campo cedula no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::CEDULA, true), true);
}
if (!ereg($patron, $direccion)) {
session::getInstance()->setError('campo direccion no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::DIRECCION, true), true);
}
if (!ereg($patron, $telefono)) {
session::getInstance()->setError('campo telefono no permite carateres especiales');
$flag = true;
session::getInstance()->setFirstCall(datosUsuarioTableClass::getNameField(datosUsuarioTableClass::TELEFONO, true), true);
}
}
示例2: __construct
function __construct($registry)
{
$this->registry = $registry;
$this->model = baseModel::getInstance();
$this->view = baseView::getInstance();
$this->request = request::getInstance();
$this->init();
}
示例3: __construct
function __construct($blockName)
{
parent::__construct();
$this->model = baseModel::getInstance();
$this->name = $blockName;
$this->request = request::getInstance();
$this->init();
$this->renderHtml();
}
示例4: validateCreate
public static function validateCreate($descripcion)
{
$flag = false;
$patternC = "^[a-zA-Z0-9]{3,20}\$";
if (ereg($patternC, $descripcion) == false) {
session::getInstance()->setError('nop');
$flag = true;
session::getInstance()->setFlash(cargoTableClass::getNameField(cargoTableClass::DESCRIPCION, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('personal', 'insertCargo');
}
}
示例5: validateCreate
public static function validateCreate($animal, $valor)
{
$flag = false;
if (empty($animal) or !isset($animal) or $animal == '') {
session::getInstance()->setError(i18n::__(10093, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClassgetNameField(detalleProcesoVentaTableClass::ANIMAL, true), true);
}
if (!is_numeric($animal)) {
session::getInstance()->setError(i18n::__(10057, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClass::getNameField(detalleProcesoVentaTableClass::ANIMAL, true), true);
}
if ($animal < 0) {
session::getInstance()->setError(i18n::__(10095, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClass::getNameField(detalleProcesoVentaTableClass::ANIMAL, true), true);
}
if ($valor < 0) {
session::getInstance()->setError(i18n::__(10116, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClass::getNameField(detalleProcesoVentaTableClass::VALOR, true), true);
}
if (empty($valor) or !isset($valor) or $valor == '') {
session::getInstance()->setError(i18n::__(10117, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClass::getNameField(detalleProcesoVentaTableClass::VALOR, true), true);
}
if (!is_numeric($valor)) {
session::getInstance()->setError(i18n::__(10118, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoVentaTableClass::getNameField(detalleProcesoVentaTableClass::VALOR, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('factura', 'indexFacturaVenta');
}
}
示例6: validateCreate
public static function validateCreate($insumo, $cantidad, $valor, $tipo)
{
$flag = false;
if (empty($id_registro) or !isset($id_registro) or $id_registro == '') {
session::getInstance()->setError(i18n::__(10107, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClassgetNameField(detalleProcesoCompraTableClass::PROCESO_COMPRA_ID, true), true);
}
if (!is_numeric($id_registro)) {
session::getInstance()->setError(i18n::__(10108, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::PROCESO_COMPRA_ID, true), true);
}
if ($id_registro < 0) {
session::getInstance()->setError(i18n::__(10109, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::PROCESO_COMPRA_ID, true), true);
}
if (empty($tipo) or !isset($tipo) or $tipo == '') {
session::getInstance()->setError(i18n::__(10044, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::TIPO_INSUMO, true), true);
}
if (!is_numeric($tipo)) {
session::getInstance()->setError(i18n::__(10085, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::TIPO_INSUMO, true), true);
}
if ($tipo < 0) {
session::getInstance()->setError(i18n::__(10086, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::TIPO_INSUMO, true), true);
}
if (empty($insumo) or !isset($insumo) or $insumo == '') {
session::getInstance()->setError(i18n::__(10047, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::INSUMO_ID, true), true);
}
if (!is_numeric($insumo)) {
session::getInstance()->setError(i18n::__(10102, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::INSUMO_ID, true), true);
}
if ($insumo < 0) {
session::getInstance()->setError(i18n::__(10103, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::INSUMO_ID, true), true);
}
if ($valor < 0) {
session::getInstance()->setError(i18n::__(10080, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::VALOR_UNITARIO, true), true);
}
if (empty($valor) or !isset($valor) or $valor == '') {
session::getInstance()->setError(i18n::__(10050, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::VALOR_UNITARIO, true), true);
}
if (!is_numeric($valor)) {
session::getInstance()->setError(i18n::__(10051, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::VALOR_UNITARIO, true), true);
}
if (empty($cantidad) or !isset($cantidad) or $cantidad == '') {
session::getInstance()->setError(i18n::__(10087, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::CANTIDAD, true), true);
}
if (!is_numeric($cantidad)) {
session::getInstance()->setError(i18n::__(10083, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::CANTIDAD, true), true);
}
if ($cantidad < 0) {
session::getInstance()->setError(i18n::__(10081, null, 'errors'));
$flag = true;
session::getInstance()->setFlash(detalleProcesoCompraTableClass::getNameField(detalleProcesoCompraTableClass::CANTIDAD, true), true);
}
if ($flag == true) {
request::getInstance()->setMethod('GET');
routing::getInstance()->forward('factura', 'indexFacturaCompra');
}
}
示例7: render
public function render()
{
$req = \request::getInstance();
// Services combo
$content = "<div id='selectbox'><select onchange=\"window.location='#'+\$(this).val();\$(this).find('option[value=\\'\\']').attr('selected','selected');\"><option value=''>-- Choisissez une méthode --</option>";
foreach ($this->services as $service) {
$content .= "<option value='" . $service . "'>" . $service . "()</option>";
}
$content .= "</select></div>";
// Request
$content .= "<div class='request'><b>Request</b> : <pre>{$this->request}</pre></div>";
// Results
if ($req->gp('base')) {
$content .= "<div class='results'>";
$content .= "<h2>RESULTATS</h2>";
$content .= "<pre>{$this->results}</pre>";
$content .= "</div>";
}
$content .= "<form>TYPE:";
foreach ($req->gp() as $k => $v) {
if ($k == "filters") {
continue;
}
if (is_array($v)) {
foreach ($v as $k2 => $v2) {
$content .= "<input type='hidden' name='{$k}" . "[" . $k2 . "]' value=\"" . htmlspecialchars($v2) . "\">";
}
} elseif (!in_array($k, array("output", "full"))) {
$content .= "<input type='hidden' name='{$k}' value=\"" . htmlspecialchars($v) . "\">";
}
}
$content .= "<label><input type='radio' name='output' value='' " . ($req->gp('output') == "" ? "checked='checked'" : "") . "/>object</label>\n\t\t\t<label><input type='radio' name='output' value='json' " . ($req->gp('output') == "json" ? "checked='checked'" : "") . "/>json</label>\n\t\t\t<label><input type='radio' name='output' value='xml' " . ($req->gp('output') == "xml" ? "checked='checked'" : "") . "/>xml</label><br>";
$content .= "<label><input type='checkbox' name='full' value='1' " . ($req->gp('full') == "1" ? "checked='checked'" : "") . "/>Infos complètes ?</label>";
$directory = "filters/";
$dir_r = opendir($directory) or die('Error filters directory');
while (false !== ($entry = readdir($dir_r))) {
if (!is_dir($directory . '/' . $entry) && $entry != '.' && $entry != '..' && !preg_match("#(^\\.|~\$)#", $entry)) {
require_once $directory . '/' . $entry;
$class = str_replace(".cls.php", "", $entry);
$rc = new ReflectionClass("\\geneweb\\api\\filters\\" . $class);
if ($rc->isAbstract()) {
continue;
}
$methods = $rc->getMethods();
$p = $req->gp("filters");
$content .= "<br/><label><input type='checkbox' name='filters[{$class}]' value='1' " . ($p[$class] == "1" ? "checked='checked'" : "") . " " . (count($methods) > 1 ? "onclick=\"(\$(this).is(':checked') ? \$(this).parent().next().show() : \$(this).parent().next().hide())\"" : "") . "/>" . $class . "</label>";
$methods = $rc->getMethods();
$defaultProperties = $rc->getDefaultProperties();
if (count($methods) > 1) {
$content .= "<div" . ($p[$class] != "1" ? " style='display:none'" : "") . "><table>";
foreach ($methods as $method) {
if ($method->name == "__construct" || preg_match("#^get#", $method->name)) {
continue;
}
$p = $req->gp("filters");
if ($p) {
$p = $p[$class . "_val"];
}
$name = lcfirst(preg_replace("#set#", "", $method->name));
$val = $p[$name];
if (empty($val)) {
$default = $defaultProperties[$name];
if ($default !== null) {
$val = $default;
}
}
$content .= "<tr><td style='text-align:right;'><label style='margin-left:50px;'>" . $name . "</label>: </td><td><input type='text' name='filters[" . $class . "_val][{$name}]' value='" . htmlspecialchars($val) . "' size='5'></td></tr>";
}
$content .= "</table></div>";
}
}
}
closedir($dir_r);
$content .= "<br/><br/><input type='submit' value='submit'/>\n\t\t\t</form>";
foreach ($this->services as $service) {
$content .= "<a name='{$service}'></a><p><h2 style='font-size:24px;font-weight:bold;'>{$service}</h2>";
$reflector = new ReflectionClass('\\geneweb\\api\\GenewebAPI');
$method = $reflector->getMethod($service);
$content .= "<pre>\n\t" . $method->getDocComment() . "\n</pre>\n";
$content .= "<form action='?output=" . $req->gp('output') . "&full=" . $req->gp('full') . "' method='post'>\n<input type='hidden' name='service' value='{$service}'>\n";
$content .= " <label><input type='radio' name='type' value='friend' " . ($req->gp('type') == "friend" ? "checked='checked'" : "") . ">Friend</label>\n";
$content .= " <label><input type='radio' name='type' value='wizard' " . ($req->gp('type') == "wizard" ? "checked='checked'" : "") . ">Wizard</label>\n";
$content .= " <label><input type='radio' name='type' value='' " . ($req->gp('type') == "" ? "checked='checked'" : "") . ">None</label>\n";
$filters = $req->gp('filters');
foreach ($filters as $k => $filter) {
if (is_array($filter)) {
foreach ($filter as $k2 => $v2) {
$content .= "<input type='hidden' name='filters[{$k}][{$k2}]' value=\"" . htmlspecialchars($v2) . "\"/>";
}
continue;
}
$content .= "<input type='hidden' name='filters[{$k}]' value=\"" . htmlspecialchars($filter) . "\"/>";
}
$content .= " <br/>\n";
$i = 0;
$content .= " <table>\n";
$content .= " <tr>\n <td align='right'>base: </td>\n <td><input type='text' name='base' value='" . $req->gp('base') . "'></td>\n </tr>\n";
foreach ($method->getParameters() as $parameter) {
$p = $req->gp('p');
$key = "input" . md5(uniqid("", true));
//.........这里部分代码省略.........