KeepLearning 0 Posted March 16, 2013 Report 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. Quote Link to post Share on other sites
Antonio Conte 426 Posted March 17, 2013 Report 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 Quote Link to post Share on other sites
KeepLearning 0 Posted March 17, 2013 Author Report 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. Quote Link to post Share on other sites
Larry 428 Posted March 18, 2013 Report 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. Quote Link to post Share on other sites
KeepLearning 0 Posted March 18, 2013 Author Report Share Posted March 18, 2013 Interesting. I'll read up on that. Thanks. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.