Guest User

Untitled

a guest
Jul 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. Link creation functions (link_to and title):
  2.  
  3. [function name=link_to&id=[id]]
  4. <a href="/[id]-[lowercase][title][/lowercase]">[capitalize][title][/capitalize]</a>
  5. [/function]
  6.  
  7. [function name=title&id=[id]][lookup db=database.db&lookinfield=id&value=[id]&return=title][/function]
  8.  
  9. Example creation view:
  10. [link_to id=1]
  11.  
  12. Example html view:
  13. <a href="/1-technical-reference">Technical Reference</a>
  14.  
  15.  
  16.  
  17.  
  18. URL interpretation functions (url_id for content lookup):
  19.  
  20. [function name=url_id][grep search=^([0-9][0-9]*).*&replace=\1][thisurl][/grep][/function]
  21.  
  22. Example URL to id in URL controller:
  23. [url_id]
  24.  
  25. Expected output: 1
  26.  
  27.  
  28. NB: that in controller, when the id is returned, the controller will know the database by inference, e.g. if an article or product or user. The controller can then look up the record with the id and render that to the view.
Add Comment
Please, Sign In to add comment