Our First DB View
From Rhypedigital
<?php # # File : Lib/View/Test.php # Copyright: 2009 # : Rhype Digital Ltd # License : This file is released under the terms of the Rhype Digital Software Licence. # : Use of this software is prohibited without express permission of Rhype # : Digital Ltd. # EMail : copyright@rhypedigital.com # require_once ('RiPHPLib/MVC/View.php' ) ; require_once ('RiPHPLib/Controls/Base.php' ) ; class Lib_View_Test extends RPL_MVC_View { function __construct ($arTest) { # Parent constructor is passed the path to the skeleton file. # parent::__construct ('Skeleton/View/Test.skel') ; # Pass the active record to the view. # $this->addActiveRecord ($arTest) ; # Create controls to display columns from the active record. These are # passed to the view to be used then the skeleton is rendered. # $id = new RPL_Controls_Base ($arTest, 'test_id' ) ; $name = new RPL_Controls_Base ($arTest, 'test_name') ; $date = new RPL_Controls_Base ($arTest, 'test_date') ; $this->addControl ($id ) ; $this->addControl ($name) ; $this->addControl ($date) ; } } ?>
