zend-framework

ZF2 empty session container between pages

人走茶凉 提交于 2019-12-13 04:25:25
问题 After looking around the internet for days, i decided to ask your help here. I got a problem with Zend Framework 2 session container management. I don't understand why, but the framework emptied all my containers each time i'm changing page. My case is simple, i'm building an online shop : The customer is on a product and click the "add to cart" button The product is saved to session The customer get back to the products list to choose another product ... but there is no product anymore in

Automatic convention-based routing within a module in Zend Framework 2--possible?

折月煮酒 提交于 2019-12-13 04:23:25
问题 I'm trying to understand all the configuration necessary to get my routing working in Zend Framework 2, and I can't help but wonder if I am making this more complicated than necessary. I am working on a simple app that will follow a very simple convention: /:module/:controller/:action I've already created and wired up my module, "svc" (short for "service)". I then created a second controller, the "ClientsController", and I can't get the routing to pass through my requests to, e.g., /svc

Doctrine_Table Vs class That extends from BaseClass

倖福魔咒の 提交于 2019-12-13 04:17:00
问题 I am a little confused in this Doctrine model concept , lets say we a table called "article" Doctrine will generate class called i am using Zend framework and Doctrine 1.2 models/generated/BaseArticle.php models/ArticleTable.php models/Article.php Is it true to call the ArticleTable in the controller in this way $tableArticle = Doctrine::getTable('Article'); then to save it in the Article Object like this $article = new Article(); $fArticles = $tableArticle->getFeaturedArticles(); foreach (

Problem with storing german words into the MySql DB…?

匆匆过客 提交于 2019-12-13 04:13:15
问题 I am facing an small issue in my project When I am trying to store some German words into the MYSQL Database . When this German words contains umlauts i.e. characters ä, ö, ß, ü etc., they are not stored as they are .....? I want to store them as it is into the Database.To do so I tried to change the COLLATION to UTF8-general-ci, and others in the list using PHP myAdmin . But none of them is working for me. Am I in the right way or I have to do something else. Please suggest some help. Thanks

Doctrine 2 + zf 1.11

北城以北 提交于 2019-12-13 04:08:57
问题 I'm trying to set up Doctrine 2 to play with ZF 1.11 for a while. I have managed to resolve all errors except one: PHP Fatal error: Class 'Doctrine\ORM\Configuration' not found in C:\development\porjects\application\Bootstrap.php on line 258 Below is the _iniDoctrine() function in the Bootstrap.php file up to the line 258 referred to by the error message: protected function _initDoctrine() { $this->bootstrap('autoload'); require_once('Doctrine/Common/ClassLoader.php'); // Create the doctrine

Zend framerwork DB DDL update

人走茶凉 提交于 2019-12-13 04:02:01
问题 I am new to zend and i want to use the DB module for an application. I have this code $DB = new Zend\Db\Adapter\Adapter(array( 'driver' => 'Mysqli', 'database' => 'database', 'username' => 'user', 'password' => 'pass' )); use Zend\Db\Sql\Ddl; use Zend\Db\Sql\Ddl\Column; use Zend\Db\Sql\Ddl\Constraint; $table = new Ddl\CreateTable('table'); $table->setTable('table'); $table->addColumn(new Column\Integer('id',false,NULL,array('autoincrement'=>true))); $table->addColumn(new Column\Varchar('name'

How can disable quote join Zend db

不问归期 提交于 2019-12-13 04:01:01
问题 I've sql query select * from table1 left join (values (4),(1800),(103500)) AS "filter (id) on table1.id=filter.id By default Zend_Db_Select table quoted. For example: $result = '(values (4),(1800),(103500)) AS filter (id)'; $select->joinInner($result, "table1.id = filter.id", ''); result: SELECT * FROM "table1" INNER JOIN "(values (4),(1800),(103500)) filter (id)" ON table1.id=filter.id Me need SELECT * FROM "table1" INNER JOIN (values (4),(1800),(103500)) filter (id) ON table1.id=filter.id

Zend - external logout / ending other sessions

送分小仙女□ 提交于 2019-12-13 03:59:37
问题 I'm writing an app using Zend Framework and I need to be able to logout users on demand. The app will receive a request containing some kind of ID's that are mapped to SessionIds and it will end/expire those sessions. I know how to do the mapping, but what then? How do I end a session having its ID? I see that there is Zend_Session::setId() , but I don't think this does what I want to do. I have an idea to just delete files that are associated with given session, since they are named sess_

Should sub-objects be fetched in the Model or the Model Mapper?

独自空忆成欢 提交于 2019-12-13 03:59:23
问题 This is a follow-up to my previous question: Should dependent rows be fetched in the Model or the Controller?. Let's say that a Patron can check out Books. If, given a Patron object, where and how should the Books they have checked out be fetched? Here are some possibilities I've considered: In the Patron Model, add a getBooks method When a Patron is instantiated, automatically get its books and store it as the books property Create a method in the PatronMapper called getBooks that takes a

Catch Zend PDO Exception

落爺英雄遲暮 提交于 2019-12-13 03:57:45
问题 I'm wondering if I can put a try catch about $application->bootstrap()->run(); that will catch pdo exceptions This works, but it catches every exception, which I do not want. try { $application->bootstrap()->run(); } catch (Exception $e) { print_r($e); } I had a nasty incident of pdo exception being throw and displaying the password from application.ini! Worthy of note, I have tried PDOException, it doesnt get catched. My DB is set up in bootstrap run() with try { $db = $this-