beautiful / view Goto Github PK
View Code? Open in Web Editor NEWView/ViewModel/Template triad for Kohana 3.x
Home Page: https://github.com/beautiful/view
View/ViewModel/Template triad for Kohana 3.x
Home Page: https://github.com/beautiful/view
Hi Luke. I am starting to build a website using Kohana 3.3 and I would like to use the MVVM model implemented by your beautiful view (Good job, by the way). I intend to use the PHP template with Beautiful View. However, I am not sure what the best approach will be to implement partials or nested views (for example, header, footer, sidebar, etc.) when using the ViewModel approach. I have tried to find your contact email, but without success. So I apologize for submitting this request, which is not really an issue. If you can find time to answer my questions and maybe include a short snippet of code illustrating how you would deal with partial views, I would greatly appreciate it. My email address is [email protected].
Thanks in advance.
Dave
I am a bit confused here as I don't get how the code can work as presently written...
In Template Class, the path() method is supposed (I guess) to use Template_Mustache or Template_PHP static $ext or $dir to generate the path. You can't access Template_Mustache::$ext from Template using self as this is presently the case : http://php.net/manual/fr/language.oop5.late-static-bindings.php
The only options I see are to use static::$ext and static::$dir or to make these properties non-static since path runs in the object context anyway...
As written now, I can't load any Mustache template since the extension self::$ext is always equal to NULL, as defined in Template.
This is my first grip on your module. That looks great !
Although I am fairly convinced View::set() should use ViewModel::set() and not ViewModel::bind(), line 250 in view.php...
Hi Luke! Thank you for sharing - this looks great!
The mustache template (as included in your example) seems to work perfectly well.
I'm having problem with the Template_Default behaviour though. Shouldn't the temlate types work transparently so that one template type could be replaced by another?
I'm trying the following:
The following example.php template...
<b>Example</b>
<?php
echo $content;
...causes this error:
ErrorException [ Notice ]: Undefined variable: content
Shouldn't the $content variable be set by the model, just the way it works when using Template_Mustache?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.