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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:20:04+00:00 2026-06-11T23:20:04+00:00

I have some experience in Zend framework. Recently I started to using Yii. Now

  • 0

I have some experience in Zend framework. Recently I started to using Yii.

Now I’m trying to find some analogy in this frameworks.

In Zend almost every route has an own name. You can create for instance a next route ‘photos_map’:

$router->addRoute('photos_map',
    new Zend_Controller_Router_Route('map/:city', array(
        'controller' => 'photos', 
        'action' => 'map',
        'city' => ''
    ))
);

And using it in view by url helper:

echo $this->url(array(), 'photos_map') // output '/map'

In Zend you can also pass the parameter (in above example it’s city) whether in the initialization or in the url-helper call.

If you want to change urls you can just change param string in the initialization map/:city to whatewer you want. It’s very useful because you don’t need to replace an old-url to a new-url everywhere in your code.

My question is this possible in Yii? I fluently read the documentation and started to thunk that Yii routes are much less powerful. Is this a sacrifice of performance or I missed something?

  • 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-11T23:20:06+00:00Added an answer on June 11, 2026 at 11:20 pm

    Routing in Yii is easy and a bit different comparing to Zend. In Yii, a view is rendered using a controller, so to render a view , you will have to call a controller. For eg, you are in the index page of a site and you want to go to preview page.

    $url = Yii::app()->createUrl('/site/preview');
    //Here site is the name of the controller class and preview is the name of the action
    //You will need to have a controller named SiteController in your controllers folder
    //You will need to have a folder named "site" in your views folder
    //You will need to have an action(function) defined as actionPreview in your controller class
    

    Now in the controller class, (in this case SiteConroller.php),

    public function actionPreview()
    {
         $this->render('preview',array('data'=>''));
         //will render preview.php located in views/site/preview.php
         //u can pass parameters in array as shown above, in this case data 
    }
    

    If you want to change the url, u can simply change the part $this->render(‘your_view_file.php’);
    I hope it helps……….Feel free to ask questions……

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some* experience using the flex framework for building web apps. But I
I have some experience of developing in Flex/Actionscript using Cairngorm framework. At that time
Hoping someone might have some experience with this. I'm using Apache POI 3.8b4 to
I have some experience with NHibernate and I'm trying to get started with Castle
I have experienced Zend Framework 1 and I've build some apps with that framework.
I have some experience using parallel extensions in .Net development, but I was looking
Hey, i have some experience with MVC. but I'm new to rails. I'm using
Does anyone here have some experience with this error? Only If I use the
Hi I'm a PHP developer and I have some experience with Java. I'm trying
I have some experience with XSLT but now i've got myself a problem: 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.