当前位置: 首页>>代码示例>>PHP>>正文


PHP Util::getParams方法代码示例

本文整理汇总了PHP中Util::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::getParams方法的具体用法?PHP Util::getParams怎么用?PHP Util::getParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util的用法示例。


在下文中一共展示了Util::getParams方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: alert

 /**
  * Método para generar un mensaje de alerta, párametros que puede recibir: "icon: icono", "title: ", "subtext: ", "name: ", "autoOpen: "
  * @param type $text
  * @param type $params
  * @return type
  */
 public static function alert($text, $params = '')
 {
     //Extraigo los parametros
     $params = Util::getParams(func_get_args());
     $icon = isset($params['icon']) ? $params['icon'] : 'icon-exclamation-sign';
     $title = isset($params['title']) ? '<i class="' . $icon . '" style="padding-right:5px; margin-top:5px;"></i>' . $params['title'] : null;
     $subtext = isset($params['subtext']) ? "<p style='margin-top: 10px'>{$params['subtext']}</p>" : null;
     $name = isset($params['name']) ? trim($params['name'], '()') : "dwModal" . rand(10, 5000);
     $autoOpen = isset($params['autoOpen']) ? true : false;
     $modal = '<div class="modal hide" id="' . $name . '">';
     $modal .= '<div class="modal-header">';
     $modal .= '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
     $modal .= $title ? "<h3>{$title}</h3>" : '';
     $modal .= '</div>';
     $modal .= "<div class=\"modal-body\">{$text} {$subtext}</div>";
     $modal .= '<div class="modal-footer">';
     $modal .= '<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Aceptar</button>';
     $modal .= '</div>';
     $modal .= '</div>';
     $modal .= '<script type="text/javascript">';
     $modal .= "function {$name}() { \$('#{$name}').modal('show'); }; ";
     if ($autoOpen) {
         $modal .= '$(function(){ ' . $name . '(); });';
     }
     $modal .= "\$('#{$name}').on('shown', function () { \$('.btn-primary', '#{$name}').focus(); });";
     $modal .= '</script>';
     return $modal . PHP_EOL;
 }
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:34,代码来源:dw_dialog.php

示例2: route_to

 /**
  * Enruta el controlador actual a otro módulo, controlador, o a otra acción
  * @deprecated Se mantiene por legacy temporalmente
  * @example
  * Redirect::route_to("module: modulo", "controller: nombre", "action: accion", "parameters: 1/2")
  */
 public static function route_to()
 {
     static $cyclic = 0;
     $url = Util::getParams(func_get_args());
     if (isset($url['module'])) {
         $vars['module'] = $url['module'];
         $vars['controller'] = 'index';
         $vars['action'] = 'index';
         $vars['parameters'] = array();
         $vars['controller_path'] = $url['module'] . '/index';
     }
     if (isset($url['controller'])) {
         $vars['controller'] = $url['controller'];
         $vars['action'] = 'index';
         $vars['parameters'] = array();
         $vars['controller_path'] = isset($url['module']) ? $url['module'] . '/' . $url['controller'] : $url['controller'];
     }
     if (isset($url['action'])) {
         $vars['action'] = $url['action'];
         $vars['parameters'] = array();
     }
     if (isset($url['parameters'])) {
         $vars['parameters'] = explode('/', $url['parameters']);
     } elseif (isset($url['id'])) {
         // Deprecated
         $vars['parameters'] = array($url['id']);
     } else {
         $vars['parameters'] = array();
     }
     if (++$cyclic > 1000) {
         throw new KumbiaException('Se ha detectado un enrutamiento cíclico. Esto puede causar problemas de estabilidad');
     }
     Router::to($vars, TRUE);
 }
开发者ID:criferlo,项目名称:empolab,代码行数:40,代码来源:redirect.php

示例3: __construct

 /**
  * Constructor del Autenticador
  *
  * @param string $adapter
  */
 public function __construct()
 {
     $extra_args = Util::getParams(func_get_args());
     if (isset($extra_args[0])) {
         $adapter = $extra_args[0];
         unset($extra_args[0]);
     } else {
         $adapter = 'model';
     }
     $this->set_adapter($adapter, $this, $extra_args);
 }
开发者ID:albertmolina,项目名称:Daily-Content-Manager,代码行数:16,代码来源:auth.php

示例4: add_node

 /**
  * Agrega un nodo a la salida XML
  * 
  * <code>
  * $xml->addNode(array('value' => 1, 'text' => 'Prueba', 'selected' => '0'));
  * $xml->addNode('value: 1', 'text: Prueba', 'selected: 0');
  * </code>
  * 
  * @param array $arr
  */
 public function add_node($arr)
 {
     $this->_xml->startElement('row');
     if (!is_array($arr)) {
         $arr = Util::getParams(func_get_args());
     }
     foreach ($arr as $key => $value) {
         $this->_xml->writeAttribute($key, $value);
     }
     $this->_xml->endElement();
 }
开发者ID:raalveco,项目名称:Escuela,代码行数:21,代码来源:xml.php

示例5: imagen

 public static function imagen($imagen, $alt = "", $w = 0, $h = 0)
 {
     $params = is_array($imagen) ? $imagen : Util::getParams(func_get_args());
     if ($alt != "") {
         $params["alt"] = str_replace(":", "###", $alt);
         $params["title"] = str_replace(":", "###", $alt);
     }
     if ($w != "") {
         $params["width"] = $w;
     }
     if ($h != "") {
         $params["height"] = $h;
     }
     $params["border"] = "0";
     return str_replace("###", ":", img_tag($params));
 }
开发者ID:raalveco,项目名称:Escuela,代码行数:16,代码来源:html.php

示例6: formularioInicio

 public static function formularioInicio($accion, $contenedor = "ajax", $referencia = 0)
 {
     $params = is_array($accion) ? $accion : Util::getParams(func_get_args());
     $params["enctype"] = "multipart/form-data";
     if ($referencia == 0) {
         $referencia = rand(0, 999999);
     }
     $params["name"] = "f" . $referencia;
     $params["id"] = "f" . $referencia;
     $opciones = 'target: "#' . $contenedor . '"';
     if (isset($params["success"])) {
         $opciones .= ', success: function() { ' . $params["success"] . ' }';
     }
     if (isset($params["before"])) {
         $opciones .= ', beforeSubmit: function() { ' . $params["before"] . ' }';
     }
     $code = '<script type="text/javascript"> $.metadata.setType("attr", "validate"); $(document).ready(function() { $("#' . $params["id"] . '").validate({});  $("#' . $params["id"] . '").ajaxForm({ ' . $opciones . ' }); }); </script>';
     $code .= form_tag($params);
     return $code;
 }
开发者ID:raalveco,项目名称:Zeus,代码行数:20,代码来源:ajax.php

示例7: internal

 /**
  * Enrutamiento interno
  * @example
  * Redirect::intern("module: modulo", "controller: nombre", "action: accion", "parameters: 1/2")
  */
 public static function internal()
 {
     static $cyclic = 0;
     $url = Util::getParams(func_get_args());
     $default = array('controller' => 'index', 'action' => 'index');
     $url['parameters'] = isset($url['parameters']) ? explode('/', $url['parameters']) : array();
     if (isset($url['module'])) {
         $vars = $url + $default;
         $vars['controller_path'] = $vars['module'] . '/' . $vars['controller'];
     } elseif (isset($url['controller'])) {
         $vars = $url + $default;
         $vars['controller_path'] = $vars['controller'];
     } else {
         $vars = $url;
     }
     if (++$cyclic > 1000) {
         throw new KumbiaException('Se ha detectado un enrutamiento cíclico. Esto puede causar problemas de estabilidad');
     }
     Router::to($vars, TRUE);
 }
开发者ID:Jamp,项目名称:sgas,代码行数:25,代码来源:redirect.php

示例8: toRoute

 /**
  * Enruta a un modelo, controlador, accion y pasa parámetros      
  */
 public static function toRoute()
 {
     $url = Util::getParams(func_get_args());
     if (!isset($url['module'])) {
         $url['module'] = null;
     }
     if (!isset($url['action'])) {
         $url['action'] = 'index';
     }
     if (!isset($url['parameters'])) {
         $url['parameters'] = null;
     }
     if (Input::isAjax() && APP_AJAX) {
         $href = trim("{$url['module']}/{$url['controller']}/{$url['action']}/{$url['parameters']}/", '/');
         echo DwJs::setUrl($href);
     }
     if ($url['parameters'] == null) {
         Redirect::route_to("module: {$url['module']}", "controller: {$url['controller']}", "action: {$url['action']}");
     } else {
         Redirect::route_to("module: {$url['module']}", "controller: {$url['controller']}", "action: {$url['action']}", "parameters: {$url['parameters']}");
     }
 }
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:25,代码来源:dw_redirect.php

示例9: imagen

    public static function imagen($imagen, $alt = "", $radio = true)
    {
        $params = is_array($imagen) ? $imagen : Util::getParams(func_get_args());
        if ($alt != "") {
            $params["alt"] = str_replace(":", "###", $alt);
            $params["title"] = str_replace(":", "###", $alt);
        }
        $params["border"] = "0";
        if ($radio) {
            $params["id"] = "jcrop";
        } else {
            $params["id"] = "jcropRECTANGULO";
        }
        $code = str_replace("###", ":", img_tag($params));
        $code .= '<input type="hidden" size="4" id="imagen" name="imagen" value="' . $imagen . '" /> 
            			<input type="hidden" size="4" id="x1" name="x1" />
						<input type="hidden" size="4" id="y1" name="y1" /> 
						<input type="hidden" size="4" id="x2" name="x2" /> 
						<input type="hidden" size="4" id="y2" name="y2" /> 
						<input type="hidden" size="4" id="w" name="w" /> 
						<input type="hidden" size="4" id="h" name="h" />';
        return $code;
    }
开发者ID:raalveco,项目名称:Zeus,代码行数:23,代码来源:jcrop.php

示例10: alert

 /**
  * Método para generar un mensaje de alerta, párametros que puede recibir: "icon: icono", "title: ", "subtext: ", "name: ", "autoOpen: "
  * @param type $text
  * @param type $params
  * @return type
  */
 public static function alert($text, $params = '')
 {
     //Extraigo los parametros
     $params = Util::getParams(func_get_args());
     $icon = isset($params['icon']) ? $params['icon'] : 'fa-exclamation-sign';
     $title = isset($params['title']) ? '<i class="' . $icon . '" style="padding-right:5px; margin-top:5px;"></i>' . $params['title'] : null;
     $subtext = isset($params['subtext']) ? "<p style='margin-top: 10px'>{$params['subtext']}</p>" : null;
     $name = isset($params['name']) ? trim($params['name'], '()') : "dwModal" . rand(10, 5000);
     $autoOpen = isset($params['autoOpen']) ? true : false;
     $button = isset($params['show_button']) && Filter::get($params['show_button'], 'lower') == 'false' ? false : true;
     $style = isset($params['style']) ? $params['style'] : '';
     $modal = '<div class="modal fade" tabindex="-1" id="' . $name . '" role="dialog" aria-labelledby="' . $name . '" aria-hidden="true">';
     $modal .= '<div class="modal-dialog" style="' . $style . '">';
     $modal .= '<div class="modal-content">';
     $modal .= '<div class="modal-header">';
     $modal .= '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';
     $modal .= $title ? "<h4 class=\"modal-title\">{$title}</h4>" : '';
     $modal .= '</div>';
     $modal .= "<div class=\"modal-body\">{$text} {$subtext}</div>";
     if ($button) {
         $modal .= '<div class="modal-footer">';
         $modal .= '<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Aceptar</button>';
         $modal .= '</div>';
     }
     $modal .= '</div>';
     $modal .= '</div>';
     $modal .= '</div>';
     $modal .= self::open();
     $modal .= "function {$name}() { \$('#{$name}').modal('show'); }; ";
     if ($autoOpen) {
         $modal .= '$(function(){ ' . $name . '(); });';
     }
     $modal .= "\$('#{$name}').on('shown.bs.modal', function () { \$('.btn-primary', '#{$name}').focus(); });";
     $modal .= self::close();
     return $modal;
 }
开发者ID:ocidfigueroa,项目名称:sice,代码行数:42,代码来源:dw_js.php

示例11: setMimes

 public function setMimes($name)
 {
     $params = is_array($name) ? $name : Util::getParams(func_get_args());
     $this->array_mimes = $params;
 }
开发者ID:al3jandro,项目名称:Tellus,代码行数:5,代码来源:dataGrid.php

示例12: limit

 /**
  * Devuelve un LIMIT valido para un SELECT del RBDM
  *
  * @param string $sql
  * @return string
  */
 public function limit($sql)
 {
     $params = Util::getParams(func_get_args());
     $limit = '';
     if (isset($params['offset'])) {
         $limit .= " SKIP {$params['offset']}";
     }
     if (isset($params['limit'])) {
         $limit .= " FIRST {$params['limit']}";
     }
     return str_ireplace("SELECT ", "SELECT {$limit} ", $sql);
 }
开发者ID:Jamp,项目名称:sgas,代码行数:18,代码来源:informix.php

示例13: limit

 /**
  * Devuelve un LIMIT valido para un SELECT del RBDM
  *
  * @param string $sql consulta sql
  * @return string
  */
 public function limit($sql)
 {
     $params = Util::getParams(func_get_args());
     $sql_new = $sql;
     if (isset($params['limit']) && is_numeric($params['limit'])) {
         $sql_new .= " LIMIT {$params['limit']}";
     }
     if (isset($params['offset']) && is_numeric($params['offset'])) {
         $sql_new .= " OFFSET {$params['offset']}";
     }
     return $sql_new;
 }
开发者ID:govaniso,项目名称:happydomain,代码行数:18,代码来源:pgsql.php

示例14: paginate_by_sql

 /**
  * Método para paginar resultados utilizando el método find_all_by_sql de los modelos <br>
  *
  * Retorna un PageObject que tiene los siguientes atributos: <br>
  * next: numero de pagina siguiente, si no hay pagina siguiente entonces es false <br>
  * prev: numero de pagina anterior, si no hay pagina anterior entonces es false <br>
  * current: numero de pagina actual <br>
  * total: total de paginas que se pueden mostrar <br>
  * items: array de items de la pagina <br>
  * counter: Número que lleva el conteo de la página <br>
  * size: Total de registros <br>
  * per_page: cantidad de elementos por pagina <br>
  *
  *
  * @param string $model modelo
  * @param string $sql consulta sql
  * @return stdClass
  */
 public static function paginate_by_sql($model, $sql)
 {
     $params = Util::getParams(func_get_args());
     $page_number = isset($params['page']) ? Filter::get($params['page'], 'numeric') : 1;
     //Numero de la página
     $per_page = isset($params['per_page']) ? Filter::get($params['per_page'], 'numeric') : DATAGRID;
     //Datos por página
     $counter = $page_number > 1 ? $page_number * $per_page - ($per_page - 1) : 1;
     //Determino el contador para utilizarlo en la vista
     $start = $per_page * ($page_number - 1);
     //Determino el offset
     $page = new stdClass();
     //Instancia del objeto contenedor de pagina
     $total_items = $model->count_by_sql("SELECT COUNT(*) FROM ({$sql}) AS t");
     //Se cuentan los registros
     $page->items = $model->find_all_by_sql($model->limit($sql, "offset: {$start}", "limit: {$per_page}"));
     //Se efectua la búsqueda
     //Se efectuan los cálculos para las paginas
     $page->next = $start + $per_page < $total_items ? $page_number + 1 : false;
     $page->prev = $page_number > 1 ? $page_number - 1 : false;
     $page->current = $page_number;
     $page->total_page = ceil($total_items / $per_page);
     if ($page->total_page < $page_number && $total_items > 0) {
         $page->prev = false;
         $url = Router::get('route');
         $url = explode('pag', $url);
         $url = trim($url[0], '/');
         DwMessage::error('La página solicitada no se encuentra en el paginador.  <br />' . DwHtml::link($url, 'Regresar a la página 1'));
     }
     $page->counter = $total_items >= $counter ? $counter : 1;
     $page->size = $total_items;
     $page->per_page = $per_page;
     return $page;
 }
开发者ID:slrondon,项目名称:MikrotikCenter,代码行数:52,代码来源:dw_paginate.php

示例15: limit

 /**
  * Devuelve un LIMIT válido para un SELECT del RBDM
  *
  * @param string $sql consulta sql
  * @return string
  */
 public function limit($sql)
 {
     $params = Util::getParams(func_get_args());
     //TODO: añadirle el offset
     if (isset($params['limit'])) {
         $sql = str_ireplace("SELECT ", "SELECT TOP {$params['limit']} ", $sql);
     }
     return $sql;
 }
开发者ID:jaigjaig,项目名称:usuario_auth_template_bootstrap,代码行数:15,代码来源:mssql.php


注:本文中的Util::getParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。