Search code examples
pyrocms

PyroCMS accessing views within a module


How do I access views within the admin panel of a custom module?


Solution

  • its very simple in link(anchor tag) you just specify the path to a method in you controller like this

    <a href="admin/your-controller-name/your-method-name">Your link</a>
    

    Now in your-controller you have to create a method your-method-name. in which you have to load a view like this

    $this->template
      ->set('your-data',$your-data)
      ->build('your-view');
    

    if your view is in admin side then you should specify it in build like this

    build('admin/your-view');