1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Call Controllermethod from ControllerHelper

Discussion in 'XenForo Development Discussions' started by ajnos, Mar 24, 2011.

  1. ajnos

    ajnos Member

    i'm trying to call a Method from a Controller in the Controller Helper.
        public function assertCategoryValidAndViewable($categoryId, array $fetchOptions = array())
    $fetchOptions += array('permissionCombinationId' => $this->_visitor['permission_combination_id']);

    $category $this->getCategoryOrError($categoryId$fetchOptions);
            if (isset(
    $forum['node_permission_cache'])) {
    $this->_visitor->setNodePermissions($category['node_id'], $category['node_permission_cache']);

            if (!
    $this->_controller->_getCategoryModel()->canView($category$errorPhraseKey)) {
    #       throw $this->_controller->getErrorOrNoPermissionResponseException($errorPhraseKey);

    _getCategoryModel is a valid method in my controller:
         * @return Ragtek_AS_Model_Category
    protected function _getCategoryModel(){
    If i run this code, i'm getting:
  2. Arik

    Arik Well-Known Member

    It's valid, but it's marked as protected, so it can't be called from outside the class.

Share This Page