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 9212093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:26:50+00:00 2026-06-18T01:26:50+00:00

I am a complete Yii newbie so please forgive a simple question. I’ve been

  • 0

I am a complete Yii newbie so please forgive a simple question. I’ve been reading up on various posts and can’t find anything that works. All I’m trying to do is setup a Yii site (which I’ve done) and then link to a static page using my Main layout.

Below are the three files I think are relevant:

  • index.php: the view I show on my homepage as content with the main layout
  • terms_of_use.php: the view I’m unsuccessfully trying to get to appear in the main layout
  • main.php: my master layout

Within the footer of the main layout, the link to the static page is:

<a href="index.php?r=site/page&view=terms_of_use">Terms of Use</a>

When I click on it, it generates what I think is the correct url in the brower address bar:

http://localhost/Company/index.php?r=site/page&view=terms_of_use

but what gets shown is the content of index.php, not terms_of_use.php. I’m using the default SiteController. Is there something special about index.php I don’t know about, or am I doing something else dumb? Thanks for any help.

views/site/index.php:

<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name;
?>

<div id="content" class = "clearfix">
    <div class="threeColBlock">
        <div class="padded">
            <h2 class="pageTitle">Heading 1</h2>
                <p>Blurb 1</p>
        </div>
    </div>
    <div class="threeColBlock">
        <div class="padded">
            <h2 class="pageTitle">Heading 2</h2>
            <p>Blurb 2</p>
        </div>
    </div>
    <div class="threeColBlock">
        <div class="padded">
            <h2 class="pageTitle">Heading 3</h2>
            <p>Blurb 3</p>
        </div>
    </div>
</div>

views/site/pages/terms_of_use.php:

<?php
/* @var $this SiteController */

$this->pageTitle=Yii::app()->name . ' - About';
$this->breadcrumbs=array(
    'About',
);
?>

<div id="content" class = "clearfix">
    <h2 class="pageTitle">Terms of Use</h2>
    <div class = "smallText">
        <p>
            Some legal junk
        </p>
    </div>
</div>

views/layouts/views/main.php:

<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="language" content="en" />

    <!-- blueprint CSS framework -->
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
    <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
    <![endif]-->

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/marketing.css">
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/cssmenu.css" media="screen" />

    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

    <div id="header"  class="clearfix">
        <div id="logo"><image src="images/logo,56x38,trans(white).gif"></div>
        <div id="logoName">Company</div>
        <div id="topRight">Bla bla bla</b></div>
    </div>

    <!-- Menu -->
    <div id='cssmenu'>
        <ul>
            <li class='active'><a href='dummy.com'><span>home</span></a></li>
            <li class='has-sub'><a href='#'><span>products</span></a>
                <ul>
                    <li><a href='dummy.com'><span>prod1</span></a></li>
                    <li><a href='dummy.com'><span>prod2</span></a></li>
                    <li class='last'><a href='dummy.com'><span>prod3</span></a></li>
                </ul>
            </li>
            <li><a href='dummy.com'><span>about</span></a></li>
            <li class='last'><a href='dummy.com'><span>contact</span></a></li>
        </ul>
    </div>

    <div id="mainImageContainer">
        <div id="mainImage">
            <image src = "images/main_image.jpg">
        </div>
    </div>

    <?php echo $content; ?>

</div><!-- page -->

    <div id="footer">
        Copyright &copy 2011 Company. All rights reserved. | <a href="index.php?r=site/page&view=terms_of_use">Terms of Use</a>
    </div>

</body>
</body>
</html>
  • 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-18T01:26:51+00:00Added an answer on June 18, 2026 at 1:26 am

    Found it. I had enabled the urlManager in config/main.php. If I change my original link to the following then I get what I want.

    http://localhost/Company/index.php/site/page/view/terms_of_use 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Complete android/eclipse newbie question... I am writing an app and making a lot of
Complete PHP newbie question here, I'm trying to load up locally a dynamic PHP
I am a complete PHP newbie and I have a specific question that might
Complete newbie researching Rails. Can Rails be used with a read-only schema that doesn't
Complete newbie question here: I'm just playing with C# for the first time and
Complete newbie question. I am developing a class for searching a movie database using
complete noob to Haskell here with probably an even noobier question. I'm trying to
Here is my complete script... You can just create test.php and throw it in.
Pardon my complete lack of javascript knowledge in advance, but I can't seem to
I'm a complete newbie and am building a HTML5 app with PhoneGap which will

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.