Ob es was von Springer oder in deiner Uni-Bibliothek gibt, kannst du doch selbst nachsehen![]()
Schon, aber dann weiß ich immer noch nicht obs gut ist
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
Ob es was von Springer oder in deiner Uni-Bibliothek gibt, kannst du doch selbst nachsehen![]()
// ...
protected function _initRouting()
{
require_once 'Zend/Loader.php';
$file = APP_DIRECTORY . '/configs/routes.ini';
if(!Zend_Loader::isReadable($file)) {
return;
}
$router = Zend_Controller_Front::getInstance()->getRouter(); // gibt standardmäßig einen Rewrite Router zurück
$router->addConfig(new Zend_Config_Ini($file, APPLICATION_ENV), 'routes');
return $router;
}
// ...
vielleicht wisst Ihr wie man in der globalen Bootstrap eine Routen Config läd und die defaults Route aber erhält.



Ist es nicht so das wenn ich einfach eine neue Route erstelle die Default gelöscht wird? So habe ich es zumindest irgendwie in Erinnerung und das ist das was ich ja nicht möchte.renderMenu($container = null, $options = array()) ist eine standardmäßige render Methode, und stellt einen Container als HTML UL Liste dar.
Wenn $container nicht angegeben wird, wird der Container der im Helfer registriert ist dargestellt.
[production]
routes.stableHost.type = "Zend_Controller_Router_Route_Hostname"
routes.stableHost.route = ":host." HTTP_HOST
routes.stablesHost.chains[0].type = "Zend_Controller_Router_Route"
routes.stableHost.chains[0].route = ":module/:controller/:action/*"
routes.stableHost.reqs.host = "\w+"
[development : production]
[testing : production]
<?php echo $this->url(array('module' => 'admin', 'host' => $stable), 'stableHost', TRUE); ?>"><?php echo $this->escape($stable); ?>
nein tut mir leid, ich hatte mit noch keinem App die Zeit auf 1.8 zu migrieren.So Leute jetzt müsst Ihr nochmal ran, evtl. weiß ja Ice weiter.
<?php
/**
* {PROJECT} Application
*
* This file is part of {PROJECT}
* Copyright (c) 2009 by RedRaft
* All rights reserved
*
* @category RedRaft
* @package Library
* @copyright RedRaft (https://www.redraft.de)
* @author Daniel Schumann
* @license {LICENSE}
* @version $Id: $
*/
/**
* Project_Model
*
* this is the abstract Project_Model class
* for the Library of my ZF Application.
* It stores some usefull methods for other Module Models.
*
* @category RedRaft
* @package Library
* @subpackage Model
* @copyright RedRaft (https://www.redraft.de)
* @license {LICENSE}
*/
abstract class Project_Model
{
/**
* Instance array for the called Model
* on request.
* @var array
*/
protected static $_modelInstances = array();
/**
* DB Connection Instance
* @var Zend_Db_Adapter_Pdo_Abstract
*/
protected $_objDb = NULL;
/**
* DbTables Klass Array
* @var array
*/
protected $_tables = array();
/**
* getMax gets the max value from the spezified Table
*
* @param string $_column the column name
* @param string $_table the Table where the column stored
* @return integer
*/
public function getMax($_column, $_table)
{
$sql = 'SELECT MAX(?) FROM ' . $this->useTable($_table)->name() . ' GROUP BY ?';
return $this->objDb->fetchOne($sql, array($_column, $_column));
}
/**
* table returns the infos of an given DbTable Class.
* The $_key parameter is optionaly, possible params are:
* NULL => for all infos
* or the params separatly from Manual @see https://framework.zend.com/manual/de/zend.db.table.html#zend.db.table.info
*
* @param string $_name
* @param NULL|string $_key
* @return array|mixed
*/
public function table($_name, $_key = 'name')
{
if(!array_key_exists($_name, $this->_tables)) {
$class = ucfirst(Zend_Controller_Front::getInstance()->getRequest()->getModuleName()) . '_Model_DbTable_' . ucfirst($_name);
$this->_tables[$_name] = new $class;
}
// returned all datas
if($_key === NULL) {
return $this->_tables[$_name]->info();
}
if(in_array($_key, array('name','cols','primary','metadata','rowClass','rowsetClass','referenceMap','dependentTables','schema'))) {
return $this->_tables[$_name]->info($_key);
}
return NULL;
}
/**
* Constructor
* fetch the db connection Resource
*
* @return unknown_type
*/
protected function __construct()
{
if($this->objDb === NULL) {
$this->objDb = Zend_Controller_Front::getInstance()->getParam('Zend_Db');
}
}
/**
* Singleton
* return the instance of an called Model.
* for examble Admin_Model_Stable::getInstance() or so on.
*
* @return object "Module"_Model_"Modelname"
*/
final public static function getInstance()
{
// PHP Version Switch
$class = version_compare('5.3', PHP_VERSION, '<=') ? get_called_class() : self::get_called_class();
if(!array_key_exists($class, self::$_modelInstances)) {
self::$_modelInstances[$class] = new $class;
}
return self::$_modelInstances[$class];
}
/**
* prevent too clone the object
* because Singleton.
*
* @return void
*/
final private function __clone() {}
/**
* Imitat the laste static Binding on PHP Version < 5.3
*
* source from: @link https://www.php.net/manual/pl/function.get-called-class.php#89478
* @return string
*/
static private function get_called_class()
{
$bt = debug_backtrace();
$lines = file($bt[1]['file']);
preg_match('/([a-zA-Z0-9\_]+)::'.$bt[1]['function'].'/',
$lines[$bt[1]['line']-1],
$matches);
return $matches[1];
}
}
<?php
/**
* {PROJECT} Application
*
* This file is part of {PROJECT}
* Copyright (c) 2009 by RedRaft
* All rights reserved
*
* @category RedRaft
* @package Library
* @copyright RedRaft (https://www.redraft.de)
* @author Daniel Schumann
* @license {LICENSE}
* @version $Id: $
*/
/**
* Admin_Model_Stable
*
* @category RedRaft
* @package Admin Modul
* @subpackage Model
* @copyright RedRaft (https://www.redraft.de)
* @uses Project_Model
* @license {LICENSE}
*/
class Admin_Model_Stable extends Project_Model
{
/**
* getStablesList fetch all stables hwo saves in DB.
* returned Format ist
* array(
* ID => NAME,
* ID2 => NAME2
* ...
* )
* The Id is the primary in stables Table and unique!
*
* @return array
*/
public function getStablesList()
{
$sql = 'SELECT `id`,
REPLACE(`name`, " ", "_") AS `name`
FROM ' . $this->table('Stable');
return $this->objDb->fetchPairs($sql);
}
}
$this->view->stables = Admin_Model_Stable::getInstance()->getStablesList();

Also wenn ich die Doku richtig verstanden habe sollte es wie folgt gehen:
*ungetestet*PHP:$this->_helper->ViewRenderer->setViewBasePathSpec(':moduleDir/views/scripts/index')->setViewScriptPathSpec(':action.:suffix');
Ich habe ein paar Seiten, die von der Ausgabe haargenau das selbe machen, von der Technik dahinter aber fast vollkommen unterschiedlich sind.also der Einsatzzweck kommt mir schon komisch vor.
wenn sie haargenau die selbe Ausgabe haben, sind Partials eine sehr gute LösungIch habe ein paar Seiten, die von der Ausgabe haargenau das selbe machen, von der Technik dahinter aber fast vollkommen unterschiedlich sind.
Oder gibt es da bessere Ansätze das ganze anzugehen mti dem ZF?
Und da es ganze Seiten sind, sind Partials nicht so ganz das was ich brauche.
autoloaderNamespaces[] = "Project_"
autoloaderNamespaces[] = "Model_"
autoloader.resourceTypes.model.namespace= "Model"
autoloader.resourceTypes.model.path= APP_DIRECTORY "/models"
Hey Leute, wenn Ihr einmal da seit, wie funzt des mit Zend Application den Resource Autoloader zu Conf´n?
SELECT table.foo, table2.bar FROM table LEFT JOIN table2 ON(table2.b_id = table.b_id) WHERE table1.s = 1 AND table2.u_id = 1 ORDER BY table2.bar
<?php
protected $_referenceMap = array(
'Table2' => array(
'columns' => 'b_id',
'refTableClass' => 'Table2',
'refColumns' => 'b_id'
)
);
?>
<?php
$table = new Table();
$tableRows = $table->fetchAll('s = 1');
?>