Comments (7)
yes that would work or you can explicitly name the view that you want to be rendered like so:
$this->Render() // <-- this will render a view based on the controller+method name
$this->Render('MyCustomView'); // <-- this will explicitly render a view named MyCustomView.tpl.php
from phreeze.
So I could do this:
<body>
<header>
<?php $this->Render('TasksHeaderView'); ?>
</header>
<section>
<div id="container">
<?php $this->Render('PostsContainerView'); ?>
</div>
<aside>
<?php $this->Render('ProjectsAsideView'); ?>
</aside>
</section
</body>
and it would render the view based on the Controller method?
That's great.
from phreeze.
oh hmm, it doesn't work quite like that. From inside the view you don't have access to Controller methods.
there's a whole bunch of various ways you could do that, either client-side or server-side. The most literal translation of what you have there would be to pull it in using jQuery, maybe something like this:
<body>
<header id="header"></header>
<section>
<div id="container"></div>
<aside id="aside"></aside>
</section
</body>
<script type="text/javascript">
$('#header').load('/taskheaderview');
$('#container').load('/postscontainerview');
$('#aside').load('/projectsasideview');
</script>
This is definitely not the only way. You could also just ->Assign all of the necessary variables on that page. If you look at the ListView templates you can see how they pull in the _header and _footer templates. You could do some combo of both techniques.
from phreeze.
Is there a solution that will have the benefit of the long polling?
from phreeze.
Well, like I was saying there's probably a bunch of ways to accomplish what I can see there from your code. You could use my solution above and just put all of that javascript inside a setTimeout and the page will just keep refreshing. That would work but perhaps would be not very efficient.
Probably a better approach would be to create some backbone models and then bind those to some views on your page.
from phreeze.
I will eventually. Today I started version 3 of my first Phreeze app and it's getting more advanced by the version :p
I think that version 4 or 5 will have Backbone relational models and at that point I will give you a copy.
from phreeze.
any progress with version 4 o 5.can u hare some ode fr us
from phreeze.
Related Issues (20)
- Greetings HOT 1
- Error after building
- Its work wordpress 4.8+?
- Phreeze Builder Broken HOT 1
- master-detail / master-detail-detail examples
- builder/analyze gives 404 on Nginx
- Generated code in scripts/model.js displays all tables regardless
- index null HOT 1
- Controler filename / classname containing space character(s)
- Stuck loading tables with varbinary?
- Error Opening MySQL Database HOT 1
- analyze Not Found HOT 1
- after instalation HOT 2
- Undefined offset: 1 in DBTable.php at line 285 HOT 1
- Jason Hinkle 1970-2016 HOT 5
- Security issue : use hash_equals() instead of '===' to compare hashes
- Show on select many-to-one
- http://192.168.32.10/phreeze/builder/analyze HOT 1
- Foreign key issue
- Problem after builder page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phreeze.