Giter Club home page Giter Club logo

view's People

Contributors

lukemorton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

view's Issues

Nested views (partials) and 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

Late static binding in Template ?

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.

Set() shouldn't use viewmodel's bind()

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...

Template_Default problem - variables not set

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:

  1. Changing the examples/application/classes/view.php so to work on the Template_Default instead of Template_Mustache:
    protected $_default_template = 'Template_Default';
  2. Adding a examples/application/views/example.php template file.
    This works fine until I try to get the a value from the View_Example view model.

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.