Set Up Browser Preview in Sublime Text or Dreamweaver
Streamline Your PHP Development Workflow Setup
Code Editor Setup Benefits
Quick Preview Access
Eliminate the need to manually type localhost URLs every time you want to preview your work. Set up keyboard shortcuts for instant browser preview.
Organized Project Structure
Keep all your PHP class files organized in a dedicated folder structure. Maintain better project management and file organization.
Streamlined Development
Reduce repetitive tasks and focus more on coding. Create an efficient workflow that saves time during development sessions.
Sublime Text vs Dreamweaver Setup
| Feature | Sublime Text | Dreamweaver |
|---|---|---|
| Setup Method | SideBarEnhancements Package | Site Definition |
| Preview Shortcut | F12 Key | Real-time Preview Menu |
| Project Management | Folder-based | Site-based with Server |
| Configuration File | SideBarEnhancements.json | Site Settings |
Sublime Text F12 Preview Setup Process
Prepare Sublime Text
Close any open files or windows and create a new file to start with a clean workspace
Add Project Folder
Navigate to the phpclass folder in your MAMP or XAMPP htdocs directory and add it to your project
Configure Preview URLs
Right-click the phpclass folder and select Project > Edit Preview URLs to open the configuration file
Apply Configuration Code
Copy the provided platform-specific code from sbe-code-mac.txt or sbe-code-win.txt and paste it into SideBarEnhancements.json
F12 may not work on Mac unless you change or disable the Show Dashboard keyboard shortcut in System Preferences > Keyboard or Mission Control settings
SideBarEnhancements Configuration Components
Local Path Specification
The first part of the configuration code specifies the exact folder path for your site files on your local computer system.
URL Testing Setup
The url_testing parameter allows you to set the URL of your local server that opens when you press F12 for quick preview.
Dreamweaver Site and Server Configuration
Create New Site
Launch Dreamweaver and create a new site named 'PHP Class' pointing to the phpclass folder in your htdocs directory
Add Testing Server
Click Servers tab, add a new server named 'php' using Local/Network connection type pointing to the same phpclass folder
Configure Web URL
Set the appropriate localhost URL (port 8888 for Mac MAMP, standard port for Windows XAMPP) for your testing server
Enable Testing Mode
Uncheck Remote server option and enable Testing server to activate the preview functionality for your development workflow
Platform-Specific Server URLs
| Feature | Mac (MAMP) | Windows (XAMPP) |
|---|---|---|
| Localhost URL | http://localhost:8888/phpclass | http://localhost/phpclass |
| Default Port | 8888 | 80 |
| Folder Path | Applications/MAMP/htdocs | C:/xampp/htdocs |
After setup, use File > Real-time Preview or File > Preview (depending on your Dreamweaver version) instead of manually typing localhost URLs. The Files panel will also display all site files for easy navigation.
Key Takeaways
to create a new server configuration.