Open classicalrehan opened 8 years ago
You must pass the parameter $content
to the controller, like:
return $this->mvc->action( 'PostController@filter', $content );
Hello,
Still I am unable to call controller.
I thing I am missing naming convention. Can you tell what is naming convention for controller file with path.
Or provide me sample code.
Thanks for help.
Thanks Rihan
Hello,
I have attached sample code, here just I am printing Hello, but not getting output, it's showing fatal error.
Please help.
Thanks Rihan
Hello,
I have just download code from your code repo i.e. http://wordpress-dev.evopiru.com/download/
but here src folder is missing as I have gone https://github.com/amostajo/lightweight-mvc
is both are interrelated?
or just share the sample code with controller model and view
Thanks Rihan
Hello Team,
I have just downloaded this plugin from your source code but I am facing problem to calling controller action.
I have created controller PostController as per your reference documents.
<?php
namespace MyApp\Controllers;
use Amostajo\LightweightMVC\Controller;
class PostController extends Controller { public function filter ( $content ) { // CUSTOM CODE return $content; } }
and save this code under controller directory with Post.php
and then I am calling this controller into Main.php
/* * Declares HOOKS and FILTERS when on admin dashboard. / public function on_admin() { // Call public Wordpress HOOKS and FILTERS here // -------------------------------------------- // i.e. // add_action( 'admin_init', array( &$this, 'admin_init' ) ); add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
/* * Add options page / public function add_plugin_page() { // This page will be under "Settings" add_menu_page( 'Settings Admin', 'Job Settings', 'manage_options', 'my-setting-admin1', array( $this, 'job_setting_page' ) ); } public function job_setting_page() { $content ="Hello";
but it's not showing passed content. It's nothign to represent any output.
Please have a look and let me know how can resolve this.
Thanks Rihan