Creating a widget using the "[Advanced] Template" renderer

Discussion in '[bd] Widget Framework' started by farang, Feb 3, 2016.

  1. farang

    farang New Member

    #1 , Feb 3, 2016
    Last edited: Feb 3, 2016
    I've been trying for quite some time now to create a widget using the "[Advanced] Template" renderer, specifying the controller name and action.

    Can I see a working very basic example of how to use the "[Advanced] Template" renderer together with a template while accessing the $controller - and $response objects?

    I need to see a skeleton controller class, how it's defined, what class to extend, parameters, and a very simple action function.
    Thanks a lot!
     
  2. farang

    farang New Member

    I have the following:

    Widget options:
    Template: helloWorld_view
    Controller: HelloWorld_ControllerPublic_Index::actionIndex


    Code:
    <?php
    
    class HelloWorld_ControllerPublic_Index extends XenForo_ControllerPublic_Abstract
    {
        public function actionIndex()
        {
            $params = array(
                'greeting' => "Hello World",
            );
    
            return $this->responseView('HelloWorld_ViewPublic_Index', 'helloWorld_view', $params);
        }
    }
    ?>
    My template, helloWorld_view
    Code:
    <div style="text-align: center;">
        <h2 style="font-size: 20px;">{$greeting}</h2>
    </div>
    The error message is:
    Code:
    The controller HelloWorld_ControllerPublic_Index does not define an action called Actionindex.
     
  3. farang

    farang New Member

     
  4. farang

    farang New Member

    9 days and still no support. The Webmaster Badge is useless.
     
  5. Regs

    Regs New Member

    #5 Regs, Feb 12, 2016
    Last edited: Feb 21, 2016
    Yeah, I'm not getting the whole set-up here myself. To be honest, I wish @xfrocks would put a price on the widget framework and support it properly - the webmaster badge is such a small cost that it almost seems silly to complain.

    Almost.
     
Loading...