Proyecto MVC

QuestionsProyecto MVC
Rufino asked 6 months ago

Tengo un proyecto MVC y requiro integrar grid, para integrarlo tambien se debe realizar tal y como se muestra en la documentacion:

include_once(“../../config.php”);

// include and create object

include(PHPGRID_LIBPATH.”inc/jqgrid_dist.php”);

$db_conf = array(

“type” => PHPGRID_DBTYPE,

“server” => PHPGRID_DBHOST,

“user” => PHPGRID_DBUSER,

“password” => PHPGRID_DBPASS,

“database” => PHPGRID_DBNAME

);

$g = new jqgrid($db_conf);

o se integra de otra forma porque al realizarlo de esta manera en un controlador me marca el error que no encuentra la clase jqgrid

Uncaught Error: Class “Controllers\Comercial\jqgrid” not found

3 Answers
Abu Ghufran Staff answered 6 months ago

If the path of the jqgrid_dist.php is corrrect, you can try appending root namespace \ before jqgrid():

$g = new \jqgrid($db_conf);

I don’t know which MVC you are using, however you can also check this laravel guide and take help:

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Rufino answered 4 weeks ago

Error al llamar on_data_display en MVC

Cual es la forma correcta de llamar la funcion valida_accion

$col1 = array();
        $col1[“title”] = “Accion”;
        $col1[“name”] = “Accion”;
        $col1[“dbname”] = “estatus”;
        $col1[“width”] = “30”;
        $col1[“align”] = “center”;
        $col1[“search”] = false;
        $col1[“sortable”] = false;
        $col1[“editable”] = false;
        $col1[“visible”] = array(“xs”,”sm”,”md”, “lg”, “xl”);
        $col1[“on_data_display”] = array( “valida_accion”, “”);
        $cols1[] = $col1;

estoy en un proyecto mvc  ya intente con
$col1[“on_data_display”] = array( $this->valida_accion, “”);

la funcion es publico

public function valida_accion($data) {
        return $buttons;
    }

Abu answered 4 weeks ago

El objeto de clase debe pasarse como segundo parámetro. Use esta sintaxis:

$col1["on_data_display"] = array("valida_accion", $this);

 

Your Answer

16 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?