コード例 #1
0
ファイル: PartHelper.php プロジェクト: famoser/php-frame
 public function readDatabaseProperties(BaseDatabaseModel $model, ViewBase $view, $excludedProps = null)
 {
     $html = "";
     $props = $model->getDatabaseArray();
     foreach ($props as $key => $val) {
         if (in_array($key, $excludedProps)) {
             continue;
         }
         if (str_ends_with($key, "Id") && strlen($key) > 2) {
             $objName = substr($key, 0, -2);
             $obj = $view->tryRetrieve($objName);
             if ($obj instanceof BaseModel) {
                 $html .= "<p><b>" . $objName . "</b>" . $obj->getIdentification() . "</p>";
             }
         } else {
             $equalHides = array("Id" => "hidden");
             $endHides = array("Password", "AuthHash");
             $equalVal = str_equals_with_any($key, $equalHides, true);
             $endVal = str_ends_with_any($key, $endHides, true);
             if ($equalVal === false && $endVal === false) {
                 $html .= "<p><b>" . $key . "</b>" . $this->formatProperty($val, $key) . "</p>";
             }
         }
     }
     return $html;
 }
コード例 #2
0
 protected function returnView(ViewBase $view)
 {
     if (is_array($this->getAdditionalViewProps())) {
         foreach ($this->getAdditionalViewProps() as $key => $val) {
             $view->assign($key, $val);
         }
     }
     return parent::returnView($view);
 }
コード例 #3
0
ファイル: DashboardView.php プロジェクト: famoser/php-frame
 public function __construct($title, $description, LeftMenu $leftMenu = null, TopBar $topBar = null)
 {
     parent::__construct($title, $description);
     $this->leftMenu = $leftMenu;
     $this->topBar = $topBar;
 }
コード例 #4
0
ファイル: ControllerBase.php プロジェクト: famoser/php-frame
 protected function returnView(ViewBase $view)
 {
     $view->setDefaultValues($this->applicationConfig["Title"], $this->applicationConfig["Description"], $this->applicationConfig["Author"], $this->applicationConfig["AuthorUrl"]);
     $view->setApplicationValues($this->applicationConfig["Name"], $this->applicationConfig["Url"]);
     return $view->loadTemplate();
 }
コード例 #5
0
 protected function returnView(ViewBase $view)
 {
     $view->setMenus($this->mainMenu, $this->subMenu);
     return $view->loadTemplate();
 }