Merge "HTMLForm: Don't render 'mw-htmlform-submit-buttons' if there aren't any buttons"
[lhc/web/wiklou.git] / includes / LinkTarget.php
index 175a839..b7132a8 100644 (file)
@@ -21,6 +21,13 @@ interface LinkTarget {
         */
        public function getFragment();
 
+       /**
+        * Whether the link target has a fragment
+        *
+        * @return bool
+        */
+       public function hasFragment();
+
        /**
         * Get the main part with underscores.
         *
@@ -37,4 +44,14 @@ interface LinkTarget {
         */
        public function getText();
 
+       /**
+        * Creates a new LinkTarget for a different fragment of the same page.
+        * It is expected that the same type of object will be returned, but the
+        * only requirement is that it is a LinkTarget.
+        *
+        * @param string $fragment The fragment name, or "" for the entire page.
+        *
+        * @return LinkTarget
+        */
+       public function createFragmentTarget( $fragment );
 }