Yii 1.1 Go to View Extension
A Visual Studio Code extension that provides click-to-open view navigation for Yii 1.1 applications, similar to Laravel's "Go to View" feature.
✨ What This Extension Does
Ever been frustrated trying to find the right view file in your Yii 1.1 project? This extension solves that by:
- 🔍 Automatically detecting
render()
and renderPartial()
calls in your PHP files
- 📁 Showing the exact file path where the view should be located
- 🚀 Providing clickable links to navigate directly to view files
- ⚡ Supporting both controllers and modules with smart path resolution
🚀 Quick Start
1. Install the Extension
Option A: From VSIX File (Recommended)
- Download the
.vsix
file from the releases
- In VS Code, press
Ctrl+Shift+X
to open Extensions
- Click the "..." menu (top right) and select "Install from VSIX..."
- Choose the downloaded
.vsix
file
- Restart VS Code
Option B: From VS Code Marketplace
- In VS Code, press
Ctrl+Shift+X
- Search for "Yii 1.1 Go to View"
- Click Install
2. Start Using
Open any PHP file with Yii render calls and you'll see:
// You'll see a clickable "Go to View: about" link above this line
$this->render("about", ['model' => $model]);
// And a "Go to View: partials/form" link above this line
$this->renderPartial("partials/form", ['data' => $formData]);
🎯 Features
CodeLens Navigation
- Clickable links appear above every
render()
and renderPartial()
call
- Shows view name and expected file path
- One-click navigation to view files
Smart Path Detection
- Controllers:
protected/views/<controller>/<view>.php
- Modules:
protected/modules/<module>/views/<controller>/<view>.php
- Nested views:
protected/views/<controller>/partials/form.php
Multiple Navigation Methods
- Click the CodeLens link above the render call
- Ctrl+Click on the view name (Go to Definition)
- Right-click and select "Go to View"
- Hover to see file path and status
View File Support
Navigate from renderPartial()
calls inside view files:
// Inside a view file, this will navigate to partials/_header.php
<?php renderPartial("partials/_header"); ?>
📁 How It Works
The extension automatically detects your Yii 1.1 project structure:
your-yii-app/
├── protected/
│ ├── controllers/
│ │ ├── SiteController.php ← Detects as "site" controller
│ │ └── UserController.php ← Detects as "user" controller
│ ├── views/
│ │ ├── site/ ← Views for site controller
│ │ │ ├── index.php
│ │ │ └── about.php
│ │ └── user/ ← Views for user controller
│ │ ├── index.php
│ │ └── edit.php
│ └── modules/
│ └── admin/ ← Detects as "admin" module
│ ├── controllers/
│ │ └── DashboardController.php
│ └── views/
│ └── dashboard/
│ └── index.php
🔧 Supported Patterns
The extension recognizes these Yii 1.1 patterns:
// Basic render calls
$this->render("viewName");
$this->renderPartial("viewName");
// With parameters
$this->render("viewName", ['param' => 'value']);
// Nested views
$this->render("partials/form");
$this->render("admin/users/list");
// Inside view files
renderPartial("partials/_header");
renderPartial("partials/forms/_contact", ['data' => $data]);
💡 Usage Examples
Example 1: Basic Navigation
// In SiteController.php
public function actionAbout()
{
// Click the "Go to View: about" link above this line
$this->render("about", [
'title' => 'About Us'
]);
}
Result: Click the link to open protected/views/site/about.php
Example 2: Module Navigation
// In admin/UserController.php
public function actionEdit($id)
{
// Click the "Go to View: edit" link above this line
$this->render("edit", [
'user' => User::model()->findByPk($id)
]);
}
Result: Click the link to open protected/modules/admin/views/user/edit.php
Example 3: Nested Views
// In any controller
$this->renderPartial("partials/form", [
'model' => $model
]);
Result: Click the link to open protected/views/<controller>/partials/form.php
🚨 Troubleshooting
Extension Not Working?
- Check file type: Make sure you're working with
.php
files
- Verify activation: Look for "Yii 1.1 Go to View" in the Extensions panel
- Check syntax: Ensure your render calls use correct Yii 1.1 syntax
Path Resolution Issues?
- Controller naming: Files must end with
Controller.php
- Module structure: Follow
modules/<name>/controllers/
pattern
- View extensions: Views must have
.php
extension
- Large projects: Initial scan may take a few seconds
- File watching: VS Code may take time to index new files
- Exclude folders: Add large directories to VS Code's
files.exclude
setting
- PHP Intelephense - Enhanced PHP language support
- Yii Framework Snippets - Yii code snippets
- PHP Namespace Resolver - Auto-import PHP classes
📞 Support
- Issues: Report bugs on the GitHub repository
- Feature Requests: Suggest new features via GitHub issues
- Questions: Ask questions in the GitHub discussions
📄 License
MIT License - feel free to use, modify, and distribute!
Made with ❤️ for the Yii 1.1 community