logo-antonella-framework-blancologo-antonella-framework-blanco
  • Documentación
  • Soporte
  • Repositorio
  • Videotutoriales
  • Idioma: Español
    • Español Español
    • English English
logo-antonella-framework-blanco
logo-antonella-framework-blanco

\admin class not found

Inicio Preguntas \admin class not found
Soporte › Categoría: Soporte › \admin class not found
1 Votar Buena Votar Mala
Pradeep ha preguntado hace 4 años

Hello Carlos,
I found the reference from CMB2 plugin documentation and give it a try.
This framework is well written and simple to understand, thanks for such great efforts.
I git cloned it and changed my namespace (CP),
I uncommented the code to activate admin pages and visited to admin page and it gave me error.

call_user_func_array() expects parameter 1 to be a valid callback, class ‘CP\Admin’ not found in C:\xampp\htdocs\plugindevelopment\wp-includes\class-wp-hook.php on line 286

After changing the line in config file,
from

«function» => __NAMESPACE__.»\Admin::option_page»,
to

«function» => __NAMESPACE__.»Admin\Admin::option_page»,
 

It worked, but content in the function dosent came to screen.

again I changed function to,

$title = ‘<h2>Hello World</h2>’;
echo $title;
// return $title;

It worked.

Is this need to do or there is another way to do it.

By the way, I am very thankful for such a helpful framework.

Etiquetas de la pregunta: class not found
1 respuestas
0 Votar Buena Votar Mala
Carlos Herrera Staff ha respondido hace 4 años

Hello, Thank you very much for using the Antonella framework !. My English is not very good, but I will try to answer as understandable as possible.
Another option is to create a Controller with:

php antonella make YourMethodController

and placing in the creation of the menu in config.php

«Function» => __NAMESPACE __ .’\ YourMethodController :: your_function’.

you can create a variable and place html or doing an include of a php file that contains html.
There are tutorials to work with the Framework but they are in Spanish. The first video is almost translated subtitles. I leave the url

https://www.youtube.com/channel/UCFxXskKnVefX7IJ96aLxKRA
Regards

Tu respuesta

Powered by Carlos Herrera

Insertar/editar un enlace

Introduce la URL de destino

O enlaza a contenido ya existente

    No se ha especificado ningún término de búsqueda. Mostrando los elementos recientes. Busca o utiliza las teclas de flecha arriba y abajo para seleccionar un elemento.