manipulate template

  • Thread starter Thread starter ragtek
  • Start date Start date
R

ragtek

Guest
Anybody found a method, to change automatic the template?

For my own Board, i'm creating a copy of the template, manipulate it and use the manipulated template with overwriting the whole controller method.

For example:
PHP:
class Ragtek_DeveloperTools_ControllerAdmin_AddOn extends XFCP_Ragtek_DeveloperTools_ControllerAdmin_AddOn
{
    /**
     * overwrite the original index action, so i can use a other template because of the export link
     */
    public function actionIndex()
    {
            $addOnModel = $this->_getAddOnModel();
            $viewParams = array(
                    'addOns' => $addOnModel->getAllAddOns(),
                    'canAccessDevelopment' => $addOnModel->canAccessAddOnDevelopmentAreas()
            );
            return $this->responseView('XenForo_ViewAdmin_AddOn_List', 'addon_list_ragtek', $viewParams);
    }

    public function actionCreateZip()
as you see i'm using 'addon_list_ragtek'instead of addon_list

But IMHO that's a very ugly way for this.

A other way would be to try a str_replace of the output, but that's IMHO too much overhead and also very ugly.
Anybody know a better way?:)

That's why we need something like TMS. PLS PLS Kier;)
 
If you edit the template and do this it should work:
PHP:
<?php

class myClass extends xenClass
{
	public function actionIndex()
    {
    	$addOnModel = $this->_getAddOnModel();
    	$xenView = parent::actionIndex();
    	$xenView->params['canAccessDevelopment'] = $addOnModel->canAccessAddOnDevelopmentAreas();
    	return $xenView;
    }
    // OR (depending on if they have subView
    public function actionIndex()
    {
    	$addOnModel = $this->_getAddOnModel();
    	$xenView = parent::actionIndex()
    	$xenView->subView->params['canAccessDevelopment'] = $addOnModel->canAccessAddOnDevelopmentAreas();
    	return $xenView;
    }

I'm not entirely sure of what you were attempting to add, but the idea is there.
 
Yes, i know that i can do this, but i can't add new elements (text, link, etc...) WITHOUT editing the template manual.
 
ThatÄs what i'm talking about:export.webp

Is it possible to add this "link => "Zip erstellen" without editing the template manual, or overwritung the action and using a complete different template?
 
Back
Top Bottom