Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8031847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:13:42+00:00 2026-06-05T01:13:42+00:00

Ok I have a controller class in Yii that I want to use a

  • 0

Ok I have a controller class in Yii that I want to use a different view folder aside from using its default view folder.

The natural behavior is when a $this->render("<view file>"); you would use the following to navigate your view file in the project…

“//” navigates project default view folder

“/” navigates current theme view folder

or do not use anything to select a view automatically in the
controller’s default view folder

but my problem is i’m not rendering a view file but a STATIC PAGE that resides in /pages folder of a certain view folder. The static page I want to navigate is a static page the resides in my current theme folder views but the default is the controller navigates the static page inside the /protected/view folder

I tried also this override to modify the controller’s view folder. I put this code in my controller that I want to render static pages in a theme folder

public function init(){
    $this->layout = "//layouts/script";
    $this->viewPath = "/js";
}

but the problem is the viewPath is readOnly variable.

Now my question is how I can render static pages that resides in my current theme’s view folders?

NOTE: please if you don’t understand my question, please don’t down vote. I’m open to change and explain my problem for you as possible as I can

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:13:43+00:00Added an answer on June 5, 2026 at 1:13 am

    When you’re overriding the actions method in your SiteController, somehow, you need to change the CViewAction‘s basePath property. It defaults to pages, as the documentation says.

    Could you try something like this?

     public function actions()
     {
         return array(
            'page'=>array(
                'class'=>'CViewAction',
                'basePath'=>'path/to/your/theme/folder'
            ),
         );
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view controller class that has to implement several protocols. Too keep
I have an action inside my controller class and I want two different routes
I have a controller that looks like this: public class PageController : Controller {
I have an abstract base Controller class and all action controllers are derived from
I am using Spring MVC with annotation configuration. I have a controller class for
I'm using yii for my web application. In one of my view I have
I have a controller class Movie . One of its action method is given
Using Spring MVC, I have this Controller class: @Controller public class LoginController { @Autowired
i have controller class UserController (in controller folder) which extends BaseController (present in app
In have a controller class that handle a Contact object. In this controller I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.