Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Winter CMS resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
About
GitHub
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
Change the following lines in file modules/system/views/exception.php: Line 21 old: ``` <p><?=$exception->getFile()?> <span>line</span> <?=$exception->getLine()?></p> ``` new: ``` <p> <a href="subl://open?url=file://<?=$exception->getFile()?>&line=<?=$exception->getLine()?>"> <?=$exception->getFile()?> <span>line</span> <?=$exception->getLine()?> </a> </p> ``` Line 59 old: ``` <td><?=$stackItem->file?></td> ``` new: ``` <td> <?php $file = (dirname(dirname(dirname(dirname(__FILE__))))); $file = str_replace('~', $file, $stackItem->file); ?> <a href="subl://open?url=file://<?=$file;?>&line=<?=$stackItem->line;?>"> <b><?=$stackItem->file?></b> </a> </td> ``` This link is for sublime text but can changed for phpstorm, vcode and other easily. Now you have to register a custom protocol handler. On linux create a file "subl-url-handler" in a destination of your choice ``` #!/usr/bin/env bash arg=${1} if [[ $arg == *"column"* ]]; then pattern=".*file(:\/\/|\=)(.*)&line=(.*)&column=(.*)" else pattern=".*file(:\/\/|\=)(.*)&line=(.*)" fi file=$(echo "${arg}" | sed -r "s/${pattern}/\2/") line=$(echo "${arg}" | sed -r "s/${pattern}/\3/") column=$(echo "${arg}" | sed -r "s/${pattern}/\4/") if [ $column == "" ]; then DISPLAY=:0.0 /opt/sublime_text/sublime_text $file:$line else DISPLAY=:0.0 /opt/sublime_text/sublime_text $file:$line:$column fi ``` then create a file /usr/share/applications/subl-url-handler.desktop ``` [Desktop Entry] Version=1.0 Type=Application Name=subl URL Handler Comment=Handle URL Scheme subl://open?url=@file&line=@line Icon=subl NoDisplay=true Categories=TextEditor;Utility; Exec=/path/to/subl-url-handler %u Terminal=false MimeType=x-scheme-handler/subl; X-Desktop-File-Install-Version=0.22 ``` and now run "sudo update-desktop-database" or "update-desktop-database" if you are root Mac-user can take a look at https://github.com/asuth/subl-handler Windows-user can find tipps at https://github.com/Octarine-Phaneron/custom_protocol
References
Add additional online resources to your trick
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Plugin Development
CMS
Twig
Themes
Deployment
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline