$index = Zend_Search_Lucene::open("/data/my_index1");
$doc = new Zend_Search_Lucene_Document();
$doc->addField(Zend_Search_Lucene_Field::Text('type','auto'));
$index->addDocument($doc);
$term = new Zend_Search_Lucene_Index_Term('auto*');
$query = new Zend_Search_Lucene_Search_Query_Wildcard($term);
$hits = $index->find($query);
f...
How would I get the last inserted ID using a multirow insert?
Here is my code:
$sql='INSERT INTO t (col1, col2, col3) VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9)'; // example
$stmt = $contactsTable->getAdapter()->prepare($sql);
$stmt->execute();
$rowsAdded=$stmt->rowCount(); // mysql_affected_rows
$lastId=$stmt->lastInsertId();
echo '<br>La...
Hello,
I'm new to zend framework so maybe this question is stupid..
I've got a default hierarchy
site
|--bootstrap.php
|--application
|--models
|-- Item.php
|-- ModelAbstract.php
|--...
Inside Item.php there's
<?php
//TODO: trying to remove this require...
require_once('ModelAbstract.php');
class CF_Model_Flower ex...
Hi all,
How print all the weeks which start with monday and end with sunday.. like below ..using Zend_date
1 04-Jan-2010-10-Jan-2010
2 11-Jan-2010-17-Jan-2010
3 18-Jan-2010-24-Jan-2010
...
Hello !
I am wondering what is the best way to validate multidimensional array using Zend_Validate with Zend_FilterInput.
Here is my current code:
$filters = array(
'symbol' => array('StripTags', 'StringTrim'),
'mode' => array('StripTags', 'StringTrim'),
);
$validators = array(
'symbol' => array('N...
I want to make redirection after login action to previous URL. Please tell me how to do that?
...
With Zend_Framework, I wondered what is considered best practice for building up the content to send in a HTML email. In my case the content of the email that is sent is determined by a number of factors, for example the number of returned rows for a specific value in the database. Because of this it makes sense for me that the content i...
Lets say i'm listing musical artists, each artist has basic information like Name, Age etc. stored in an artist table. They also have entries in an Albums table (album name/album cover etc), referencing the artist table using the artist id as a foreign key.
I have the Model_Artist (Artist.php) file:
class Model_Artist extends Zend_Db_...
Still pulling my hair out with Zend_Form and any elements that need to be placed in a sub-array. form->populate() does not work when working with elements within a sub-form that have been set to a parent array using belongsTo() - I think it is actually a bug in Zend_Form->setDefaults() but just wanted to see if anyone else has a) had the...
I'm creating a php cli program to generate unit tests for our project. in the command line a enter a sourcefile and a destination file. If the destination file allready exists I parse it with Zend_CodeGenerator_File::fromReflection(). The destination file is the unit test class file. Then I check what methods need to be added to the unit...
I need to put flash uploader between form elements. Could you please tell me how to do it?
...
I read via this post how to turn on error reporting in Zend Framework but WHERE exactly do you put these statements? I've tried in public/index.php, in the file I'm working in, initializer.php but nothing prints out errors, always just a blank screen.
It's beyond me why a framework would come with a setting like this by default. Anyone ...
how can we get number of weeks of current year,
for example if it's 2009 there are 53 weeks and 2010 has 52
...
I've setup my application with Zend_Application. I have an _initAutoload() method in my Bootstrap.php wich looks like this:
public function _initAutoload(){
$this->bootstrap("frontController");
$front = $this->frontController;
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Cli...
What do these mean in MySQL? I'm using MySQL workbench and I see I can specify a new column as these... (I noted my guesses)
PK – (primary key)
NN – (non null)
BIN – (binary?)
UN – (Unicode?)
ZF- (???)
AI – (autoincrement?)
Is AI exactly like an Identity specification in MSSQL? (Can I insert a record without specifying the value and ...
Hi,
What is the best way to verify that a link with a specific url and content exists on a tested page? I'm using Zend_Test and the following simplified example works fine until there is a dot (".") in the url, which obviously can happen very often...
This is OK:
$this->assertQueryContentContains('a[href="/index"]', 'Home');
Now if...
config:
resources.frontController.plugins.nav = "WD_Controller_Plugin_Nav"
bootstrap:
protected function _initAutoloader() {
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('WD_');
return $loader;
}
protected function _initNav() {
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$...
I have a form which need users to fill. After being filled, I want to the page convert to PDF.
Does ZF pdf module provide this function?
Thanks a lot.
...
I am using MVC in PHP based Zend Framework. This is more of a design question. I have a controller that has a couple of actions. These actions are accessed via AJAX from the controller's view. The controller's actions, perform Business logic by accessing data from functions inside a model, and construct or echo HTML. This HTML is spit ba...
Hello all,
I have following problem, I need to build lucene index for articles which are tagged.
Here is simplified data structure and lucene proposal:
article_id -> unindexed
article_title -> UnStored
article_content -> UnStored
article_tags -> ????? (here is the problem)
So article can have multiple tags. Lets say we have an artic...