UNPKG

grunt-doctrine

Version:

Grunt plugin to convert doctrine xml annotations into backbone models and collections. Useful in conjunction with doctrine apigility. Includes option to scaffold an entire BBB application

70 lines (56 loc) 1.7 kB
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>03.Events</title> <link rel="stylesheet" href="../_assets/theme.css"> </head> <body> <!-- Layout will be inserted here. --> <div class="main"></div> <!-- Layout template. --> <script class="template" type="template" id="layout"> <h1>Hello world!</h1> <p></p> </script> <!-- View template --> <script class="template" type="template" id="view"> This is some content... </script> <!-- Dependencies. --> <script src="../../test/vendor/jquery.js"></script> <script src="../../test/vendor/underscore.js"></script> <script src="../../test/vendor/backbone.js"></script> <!-- LayoutManager library. --> <script src="../../backbone.layoutmanager.js"></script> <!-- Example code. --> <script contenteditable="true"> // Create a View to be used with the Layout below. var View = Backbone.Layout.extend({ template: "#view", // When you click the View contents, it will wrap them in a bold tag. events: { "click": "wrapElement" }, wrapElement: function() { this.$el.wrap("<b>"); } }); // Create a new Layout. var layout = new Backbone.Layout({ // Attach the Layout to the main container. el: ".main", // Use the previous defined template. template: "#layout", // Declaratively bind a nested View to the Layout. views: { "p": new View() } }); // Render the Layout. layout.render(); </script> <h3><a href="04.Append.html">Next example: Appending a View.</a></h3> </body> </html>