KeepLearning Posted March 16, 2013 Share Posted March 16, 2013 Version 0.5 page 120 Quoting from the book: "{TIP} To link to an anchor point on a page, pass ’#’ => ’anchorId’ as a parameter." What is "anchorId" ? An example would be helpful here. Thanks. Link to comment Share on other sites More sharing options...
Antonio Conte Posted March 17, 2013 Share Posted March 17, 2013 It's very good use IDs in longs texts. Think law data, etc. That way, you can link directly to a heading (or other element) in the middle of a web page. Where you call the method: // inside a class $param = array("#" => "law-4.2") $this->someMethod($param); // Might have other params... And in a view file: <!-- Creating a heading with an anchorID --> <h2 id="law-4.2">§ 4.2 - Important law</h2> Where the URL would look something like: http://domain.com/controllerID/actionID/#law-4.2 Link to comment Share on other sites More sharing options...
KeepLearning Posted March 17, 2013 Author Share Posted March 17, 2013 Antonio: I'm not familiar with your html syntax. I've always done it this way: <p><a href="#Arrive here">Click here</a></p> <p> </p> <p><a name="Arrive here">Arrive here</a></p> My way does not involve any id, which is why I did not understand the term "anchorid". I am puzzled that we are creating anchor points differently. What do you think? Thanks. Link to comment Share on other sites More sharing options...
Larry Posted March 18, 2013 Share Posted March 18, 2013 This is a totally minor point, but it's more conventional to use IDs for anchors these days. In part this is because IDs are often being used for other reasons already and using "a name=" has no meaning except as an anchor. Link to comment Share on other sites More sharing options...
KeepLearning Posted March 18, 2013 Author Share Posted March 18, 2013 Interesting. I'll read up on that. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts