March 2020
Intermediate to advanced
608 pages
17h 17m
English
The UrlBase class is an abstract model that has three methods, as follows:
The get_url() and get_url_path() methods are expected to be overwritten in the extended model class, for example, Idea. You can define get_url(), and get_url_path() will strip it to the path. Alternatively, you can define get_url_path(), and get_url() will prepend the website URL to the beginning of the path.
The rule of thumb is to always overwrite the get_url_path() method.
In the templates, use get_url_path() when you need a link to an object on the same website, as follows:
<a href=" ...