[fw-general] usage of Zend_Db_Table_Row

2007-07-11 Thread Nayana Hettiarachchi
Hi There,

 

Congratulations on the 1.0.0 release, I am coming getting back to ZF
after 0.7.0 and its great to see very good progress. Excellent work. 

 

I have a small question regarding implementing a Zend_Db_Table_Row
class, the documentation says the following. 

 

9.6.5.1. Defining Custom Logic for Insert, Update, and Delete in
Zend_Db_Table_Row

The Row class calls protected methods _insert(), _update(), and
_delete() before performing the corresponding operations INSERT, UPDATE,
and DELETE. You can add logic to these methods in your custom Row
subclass.

 

I have a custom Zend_Db_Table_Row class that is associated with a
Zend_Db_Table object,

 

When I work directly on the Zend_Db_Table object and call the insert()
method I don't see that the protected _insert method of the row class
being called. I try to trace through the library code and I did not see
anything apparent that would perform this either. However retrieving a
row by calling createRow() method and calling the save() method does
call the _insert() method. 

 

Is this the intended behavior ? if so then the example provided in the
documentation may not be correct, 

 

Example code

 

//

class Account extends Zend_Db_Table_Abstract

{

   protected $_name = 'account';

   protected $_rowClass = 'CustomRow';

}

class CustomRow extends Zend_Db_Table_Row_Abstract

{

   protected function _insert()

   {

  $this-_data['created_by'] = 21;

   }

}

//test cases 

 

//This method works and calls the _insert() and I see the audit column
created_by populated with value 21 in the db

public function testAddAccountWithRow()

{

   $a = new Account(array('db' = $this-__fixture));

   $row = $a-createRow();

   $row-account_name = 'Unit Test Code via createRow';

   $row-save();

}

//this method doesn't work. With or without specifying the rowClass at
object creation

public function testAddAccountDirect()

{

$a = new Account(array('db' = $this-__fixture, 'rowClass' =
'CustomRow'));

$a-insert(

 array('account_name' = 'Inserting Direct')

  );

}



 

I apologize beforehand if I am asking something that has already been
answered, I tried to search across the mailing list and did not see any
relevant hits. 

 

Nayana Hettiarachchi 

 



Re: [fw-general] Release Schedule

2007-07-11 Thread Pádraic Brady
Hi,

Just to clarify what Layout means? - I'm being told elsewhere that 
Zend_Layout is being accepted but I assume there's no proposal acceptance yet. 
I mean we have three varying methods of doing layouts - Zend_View Enhanced, 
Zend_Layout, and Matthew's Two-Step View - which differ primarily in how and 
where in the V and C they are executed. It got lost a while back in all the 
noise generated by the debate between me and Ralph which ended rather abruptly 
on the list but I'd like to see some consideration towards implementing both. 
The reasoning is simple enough - both are non-conflicting methods and each 
facilitates a preferred MVC practice in the community. Both current proposals 
are also not equal in scope and goals - another point seemingly lost is that 
Layouts is just one part of Zend_View Enhanced proposes.

Those of us preferring View Helpers for reading Models into a View would 
usually prefer a simpler decorator approach in Zend_View that leaves the 
Controller out of the equation - we don't really want to be forced to use a 
multiple Controllers in place of a simple 25 line decorator nor to return to 
the status quo where we have to subclass Zend_View, adopt a Two-Step View 
(another custom plugin) or just take a leap and replace it altogether.

Contrary to the growing belief, both Layout strategies shouldn't be considered 
as being in competition. I said very early on that implementing both could be a 
major plus to the community, and this should be given some weight going forward.

Kind regards,
Paddy
 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Aaron D. Campbell [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Monday, July 9, 2007 11:05:35 PM
Subject: [fw-general] Release Schedule

I see the roadmap, with some of the future things to be implemented in 
ZF, but is there a release schedule?  Specifically I'd like to see when 
Zend_Layout is coming out.  I was told it would be included in 1.1, but 
when is that due out?







  

Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 

Re: [fw-general] header and footer

2007-07-11 Thread Xavier Vidal Piera

This is what i do, maybe it could be useful for you:

I have a file called portal.php, which is the main template and its
contents are:

?php

echo $this-render('header.php');

echo $this-render($this-tplMain);

echo $this-render('footer.php');

?

So, in my controller i've only to do this call:

?php

class IndexController extends Zend_Controller_Action
{
   public function IndexAction()
   {
   $this-tplMain = 'index/index.php';
   echo $this-render('portal');
   }
}

Hope it helps



2007/7/11, Paulo Nei [EMAIL PROTECTED]:


 Hi,

I wanna put header  footer in all view templates.

But with ZF I don't got an easy way to do it:

* if I use something like hooks:

public function preDispatch()
{
  $this-render('header', null, true);

When I call _forward() the header is rendered twice.
And I cannot put view variables in the header (for example, error
messages), because it is rendered before the action is called and the
variables are populated.

* if I call explicity in the action:

$this-render('header', null, true);
$this-render('someaction');
$this-render('footer', null, true);

I repeat too much code in all actions and HAVE to call 
$this-render('someaction')
explicity

* if I call in the view:

?php echo $this-render('header.phtml') ?

I have to put it in all views...

* I can override the render() method in the controller, but it is too
complex for something too simple.

Someone have ideas?


Paulo








--
Xavier Vidal Piera
Enginyer Tècnic Informàtic de Gestió
Tècnic Especialista Informàtic d'equips
[EMAIL PROTECTED]
610.68.41.78


Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Jurriën Stutterheim
The problem with your new setup is that the model is still closely  
linked to the table subclass (the gateway).
If you use a data source other than the gateway, you'll have to  
rewrite your model interaction, 'cuz the insert() and update() etc.  
functions may no longer be available.
Instead, try the following. It uses a factory as middle layer and  
seperates the model creation from the datasource:


?php
/**
The model. Can be a child of an abstract model class to have a  
generic way of getting/setting attributes.

*/
class Book
{
private $_id;
private $_author;
private $_title;

/** Other model methods (get/set or anything) */
}

/**
The factory middel class. Called library cuz of the neat example.
You could call it Book_Factory or whatever.
*/
class Library
{
private static $_dataSource;

/** Singleton */
private static function getDataSource()
{
if (self::$_dataSource == null)
{
self::$_dataSource = new Book_Table;
}

return self::$_dataSource;
}

public static function newInstance()
{
return new Book();
}

public static function persist(Book $book)
{
return self::getDataSource()-persist($book);
}

public static function deleteByID($id)
{
return self::getDataSource()-deleteByID($id);
}

public static function getByID($id)
{
$rowSet = self::getDataSource()-getByID($id);

$instance = self::newInstance();
$instance-useRow($rowSet-current());

return $instance;
}

public static function getByIDWithAuthorInstance($id)
{
$book = self::getByID($id);
/**
 * Authors is the factory class for Author
 */
$author = Authors::getByID($book-author);
$book-setAuthor($author);

return $book;
}
}

/**
 * Here is your data class.
 */
class Book_Table extends Zend_Db_Table_Abstract
{
public function persist(Book $book)
{
/**
 * You'd be validating and building the data array here.
 * I made up the hasID just now... check if there's an ID.
 */
if ($book-hasID()) {
/**
 * Don't forget to specify a WHERE!
 */
return $this-update($bookData, $whereString);
} else {
return $this-insert($bookData);
}
}

public function deleteByID($id)
{
$whereString = $this-getAdapter()-quoteInto('id=?', $id);
return $this-delete($whereString);
}

public function getByID($id)
{
/**
 * Just return all results from here. The instancing logic  
will be done in the factory

 */
return $this-find($id);
}
}


As you can see the factory class provides a great deal of  
flexibility, without the model having to know anything about how or  
where it's contents are stored.
Of course this is just an example and may be implemented in a  
slightly different manner.


On 11 Jul 2007, at 01:35, Sam Davey wrote:



Hi Mark,

I've just finished refactoring my design using the feedback from my  
original
post. I'll describe what I've done which might help you... or  
others can

stop me in my tracks and tell me I'm going the wrong way about it.

First here is a simplified version of my structure

|-- controllers
|-- models
| |-- Product.php
| |-- Product
| | |-- Gateway.php

| |-- Manufacturer.php
| |-- Manufacturer
| | |-- Gateway.php

| |-- Distributor.php
| |-- Distributor
| | |-- Gateway.php

|-- views

Using the PEAR naming convension and folder structure this  
illustrates 6
classes Product and Product_Gateway, Manufacturer and  
Manufacturer_Gateway,

Distributor and Distributor_Gateway.

Basicaly my original models which extended the Zend_Db_Table have  
now been
turned into Gateways to speak to the specific related table.  These  
look

something like this:

class Product_Gateway extends Zend_Db_Table
{
protected $_name = 'product';
private $_pager = NULL;

 public function findByFilter($fValues, $perPage=NULL,
$offset=NULL)
{
  // Custom find method which is why Zend_Db_Table was
extended
  }
}

So currently my Product model only contains the following code

class Product
{
public function gateway()
{
return new Product_Gateway();
}
}

Now in my controller, in the ever present add, edit and delete  
actions I

simply use the following code
$this-model = new Product();
$this-model-gateway()-insert($data);  // or -update($data), or
-delete($data)

There is obviously data validation/filtering needed in the  
controller to

prepare the data.  But these two lines deal with the database via the
gateway.

Does this 

Re: [fw-general] header and footer

2007-07-11 Thread Mark
I'll second that. I'm in the UK, and so it regularly feels like we have to 
wait for America to spin around into the Sun before it comes up again :)

I wonder if there is a senior community member this side of the Atlantic who 
could be entrusted to perform the complicated manual restart?

Regards,
Mark

On Wednesday 11 July 2007 08:28, Pádraic Brady wrote:
 Isn't the Wiki always down? ;) It usually only goes back up late in GMT
 time.



Re: [fw-general] Release Schedule

2007-07-11 Thread Mark
Is this still happening?

http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS+Zend_Layout+Throwdown

I've never been to a Throwdown. Of course it's on the Wiki so right now I 
can't check it.

Regards,
Mark

On Wednesday 11 July 2007 08:54, Pádraic Brady wrote:
 Hi,

 Just to clarify what Layout means? - I'm being told elsewhere that
 Zend_Layout is being accepted but I assume there's no proposal acceptance
 yet. I mean we have three varying methods of doing layouts - Zend_View
 Enhanced, Zend_Layout, and Matthew's Two-Step View - which differ primarily
 in how and where in the V and C they are executed. It got lost a while back
 in all the noise generated by the debate between me and Ralph which ended
 rather abruptly on the list but I'd like to see some consideration towards
 implementing both. The reasoning is simple enough - both are
 non-conflicting methods and each facilitates a preferred MVC practice in
 the community. Both current proposals are also not equal in scope and goals
 - another point seemingly lost is that Layouts is just one part of
 Zend_View Enhanced proposes.

 Those of us preferring View Helpers for reading Models into a View would
 usually prefer a simpler decorator approach in Zend_View that leaves the
 Controller out of the equation - we don't really want to be forced to use a
 multiple Controllers in place of a simple 25 line decorator nor to return
 to the status quo where we have to subclass Zend_View, adopt a Two-Step
 View (another custom plugin) or just take a leap and replace it altogether.

 Contrary to the growing belief, both Layout strategies shouldn't be
 considered as being in competition. I said very early on that implementing
 both could be a major plus to the community, and this should be given some
 weight going forward.

 Kind regards,
 Paddy

 Pádraic Brady
 http://blog.astrumfutura.com
 http://www.patternsforphp.com


 - Original Message 
 From: Aaron D. Campbell [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Monday, July 9, 2007 11:05:35 PM
 Subject: [fw-general] Release Schedule

 I see the roadmap, with some of the future things to be implemented in
 ZF, but is there a release schedule?  Specifically I'd like to see when
 Zend_Layout is coming out.  I was told it would be included in 1.1, but
 when is that due out?







  
 ___
_ Park yourself in front of a world of choices in alternative
 vehicles. Visit the Yahoo! Auto Green Center.
 http://autos.yahoo.com/green_center/



Re: [fw-general] header and footer

2007-07-11 Thread Olivier Sirven
+1 to that.
Please don't leave us this way ;)

Le mercredi 11 juillet 2007, Mark a écrit :
 I'll second that. I'm in the UK, and so it regularly feels like we have to
 wait for America to spin around into the Sun before it comes up again :)


Re: [fw-general] Release Schedule

2007-07-11 Thread Pádraic Brady
Hi Mark,

When I checked it last, Ralph had yet to post a response there. If he does, and 
assuming the Wiki is up of course ;), I'll post another response and set a 
second question.

Paddy
 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Mark [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 9:37:13 AM
Subject: Re: [fw-general] Release Schedule

Is this still happening?

http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS+Zend_Layout+Throwdown

I've never been to a Throwdown. Of course it's on the Wiki so right now I 
can't check it.

Regards,
Mark

On Wednesday 11 July 2007 08:54, Pádraic Brady wrote:
 Hi,

 Just to clarify what Layout means? - I'm being told elsewhere that
 Zend_Layout is being accepted but I assume there's no proposal acceptance
 yet. I mean we have three varying methods of doing layouts - Zend_View
 Enhanced, Zend_Layout, and Matthew's Two-Step View - which differ primarily
 in how and where in the V and C they are executed. It got lost a while back
 in all the noise generated by the debate between me and Ralph which ended
 rather abruptly on the list but I'd like to see some consideration towards
 implementing both. The reasoning is simple enough - both are
 non-conflicting methods and each facilitates a preferred MVC practice in
 the community. Both current proposals are also not equal in scope and goals
 - another point seemingly lost is that Layouts is just one part of
 Zend_View Enhanced proposes.

 Those of us preferring View Helpers for reading Models into a View would
 usually prefer a simpler decorator approach in Zend_View that leaves the
 Controller out of the equation - we don't really want to be forced to use a
 multiple Controllers in place of a simple 25 line decorator nor to return
 to the status quo where we have to subclass Zend_View, adopt a Two-Step
 View (another custom plugin) or just take a leap and replace it altogether.

 Contrary to the growing belief, both Layout strategies shouldn't be
 considered as being in competition. I said very early on that implementing
 both could be a major plus to the community, and this should be given some
 weight going forward.

 Kind regards,
 Paddy

 Pádraic Brady
 http://blog.astrumfutura.com
 http://www.patternsforphp.com


 - Original Message 
 From: Aaron D. Campbell [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Monday, July 9, 2007 11:05:35 PM
 Subject: [fw-general] Release Schedule

 I see the roadmap, with some of the future things to be implemented in
 ZF, but is there a release schedule?  Specifically I'd like to see when
 Zend_Layout is coming out.  I was told it would be included in 1.1, but
 when is that due out?







  
 ___
_ Park yourself in front of a world of choices in alternative
 vehicles. Visit the Yahoo! Auto Green Center.
 http://autos.yahoo.com/green_center/








   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos  more. 
http://mobile.yahoo.com/go?refer=1GNXIC

Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Mark
Interesting and I like Karol Grecki's suggestion about using  __call() to 
provide $model-insert() as an alternative to $this-_gateway-insert()

With Bill's comments and Sam's approach. I've found myself arriving at this 
example. Is it viable? Any comments?

|-- controllers
|-- models
|   |-- Product
|   |   |-- Abstract.php  (My_Model_Record_Interface. isValid(), getTitle())
|   |   |-- Gateway.php (Zend_Table_Abstract or other data resource)
|   |   |-- HouseKeeping.php (Product_Abstract. Special use cases)
|   |   `-- MonthlyStats.php (Product_Abstract. Special use cases)
|   `-- Product.php (Product_Abstract. General CRUD usage)
`-- views

Regards,
Mark Maynereid


On Wednesday 11 July 2007 00:35, Sam Davey wrote:
 Hi Mark,

 I've just finished refactoring my design using the feedback from my
 original post. I'll describe what I've done which might help you... or
 others can stop me in my tracks and tell me I'm going the wrong way about
 it.

 First here is a simplified version of my structure

 |-- controllers
 |-- models
 |
 | |-- Product.php
 | |-- Product
 | |
 | | |-- Gateway.php
 | |
 | |-- Manufacturer.php
 | |-- Manufacturer
 | |
 | | |-- Gateway.php
 | |
 | |-- Distributor.php
 | |-- Distributor
 | |
 | | |-- Gateway.php
 |
 |-- views

 Using the PEAR naming convension and folder structure this illustrates 6
 classes Product and Product_Gateway, Manufacturer and Manufacturer_Gateway,
 Distributor and Distributor_Gateway.

 Basicaly my original models which extended the Zend_Db_Table have now been
 turned into Gateways to speak to the specific related table.  These look
 something like this:

 class Product_Gateway extends Zend_Db_Table
 {
   protected $_name = 'product';
   private $_pager = NULL;

  public function findByFilter($fValues, $perPage=NULL,
 $offset=NULL)
   {
   // Custom find method which is why Zend_Db_Table was
 extended
   }
 }

 So currently my Product model only contains the following code

 class Product
 {
   public function gateway()
   {
   return new Product_Gateway();
   }
 }

 Now in my controller, in the ever present add, edit and delete actions I
 simply use the following code
 $this-model = new Product();
 $this-model-gateway()-insert($data);  // or -update($data), or
 -delete($data)

 There is obviously data validation/filtering needed in the controller to
 prepare the data.  But these two lines deal with the database via the
 gateway.

 Does this sound like an okay method to others?  I realise it could be
 abstracted further via the factory method to serve gateway objects, that
 way other gateway classes could be created to save to flat files or XML
 etc. But thats not really necessary for my application.


 In answer to my original question about more complicated things such as
 data required from joins etc... after further investigation of Prados
 rather complex solution and in light of Bill's respose and Bryce's $0.02...
 it looks like anything related to this issue should just be whacked in the
 Product model... its looking sparce now anyway.

 The reason I'm so interested is because a large proportion of my job
 involves creating reports for people based on our data.  Loads of reports,
 and currently just in individual scripts away from any MVC architectue...
 each with their own queries and perhaps queries within queries.

 If moving over to MVC it looks like the queries and sub queries for all
 these reports should just be shoved in corresponding models?  Am I right?



[fw-general] Temperature conversions

2007-07-11 Thread Belmin Fernandez

I was trying out the temperature conversions and I realized I was
getting the wrong values. I looked at Zend/Measure/Temperature.php and
it seems the math is incorrect. Currently:

   'CELSIUS'= array(array('' = 1, '+' = 274.15),'°C'),
   'FAHRENHEIT' = array(array('' = 1, '-' = 32, '/' = 1.8,
'+' = 273.15),'°F'),

Should be:

   'CELSIUS'= array(array('' = 1, '+' = 273.15),'°C'),
   'FAHRENHEIT' = array(array('' = 1, '+' = 459.67, '/' = 9,
'*' = 5 ),'°F'),

I am incorrect about this? I'm assuming I'm missing something or
atleast doubt I'm the first person to catch it.

--Belmin


Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Brian Caspe

I've had a question about this too, though specifically it doesn't
really deal with pulling one book. I was wondering what solutions
people have for wanting to pull a set of books (to use the earlier
example) from a category (say, biography) and then limit the list (for
paging).

I had guessed that the solution would be to get the relevant category
row, then pull all the books for that category, (findManyToManyRowset)
but there doesn't seem to be a clean way to limit the books. I'm most
likely missing something.

brian


[fw-general] Zend_Db_*_Oracle comments

2007-07-11 Thread Duncan, Craig
I have been exploring ZF to implement for my client and found a few
interesting things that I thought might be of interest to others using
the Oracle oci8 driver. While not really broken, the support for the
Oracle oci8 driver does appear to be missing a few useful / convenient
features:

 

The Zend_Db_Oracle driver ignores the 'host' parameter. This is only an
issue when PHP is compiled with Oracles instant client which need not
use TNS. For instance the following $dsn throws the following exception
TNS:could not resolve the connect identifier specified

 

Fails:

$dsn = array(

'host'  ='myhost',

'username'  = 'zend',

'password'  = 'zend',

'dbname'= 'xe',

'options'   = $options

);

 

This is not surprising since the instant client does not use TNS as
stated. To get this to work you need to prepend the 'dbname' parameter
with the host name, which although easy to do is not very intuitive. 

 

Works:

$dsn = array(

'host' = 'totally ignored',

'username'  = 'zend',

'password'  = 'zend',

'dbname'= 'myhost/xe',

'options'   = $options

);

 

Perhaps this could be fixed in the next minor release? It would be
backward compatible, and it would support the claim that Zend Core for
Oracle is optimized for Oracle Database 10g client libraries. Support
for different ports (other than the default 1521) in the options array
would also be nice to have. (Creole for example supports both these
features)

 

Zend_Db_Statement_Oracle

This class states that it does not support case folding due to a
limitation of the Oci8 driver. The driver may not support case folding,
but after a quick review of the code I was curious as to why this was
not emulated, at least for results being returned as an associative
array (objects would not be much of a stretch either)? This would be a
great feature to have and save those looking for this feature from
having to call the array_change_key_case() function on every row
returned :-)

 

Finally, curiosity has me pondering why the name of the public method
Zend_Db_Statement_Oracle::_execute() is public. Should this not be a
protected method since Zend_Db_Statement_Oracle::_prepare() is protected
and neither appear to be designed to be called from a different scope?

 

Craig Duncan



Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Ian Warner
I create my models, and then spit the data to a View Helper called Table 
Render


This table render utilises PEAR Structures so I can expose the data in 
many different ways, including an HTML table, CSV, XML, Excel, PDF etc.


Just another abstraction layer to help with reporting, it also does 
paging, filtering and header ordering


Would be nice if Zend could create somthing similar to this that binds 
in with the framework


Ian


Brian Caspe wrote:

I've had a question about this too, though specifically it doesn't
really deal with pulling one book. I was wondering what solutions
people have for wanting to pull a set of books (to use the earlier
example) from a category (say, biography) and then limit the list (for
paging).

I had guessed that the solution would be to get the relevant category
row, then pull all the books for that category, (findManyToManyRowset)
but there doesn't seem to be a clean way to limit the books. I'm most
likely missing something.

brian



Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Dylan Arnold

I started following the gateway() approach then read the next posts.

I'm thinking about making a model class and extending my models from that.

The model class will have all the db_table methods like insert, update etc.

My models will then all extend from the model class so that they have all
the original table methods available. In the constructor or some init method
or something they will set the corresponding db_table object for use.


On 7/12/07, Ian Warner [EMAIL PROTECTED] wrote:


I create my models, and then spit the data to a View Helper called Table
Render

This table render utilises PEAR Structures so I can expose the data in
many different ways, including an HTML table, CSV, XML, Excel, PDF etc.

Just another abstraction layer to help with reporting, it also does
paging, filtering and header ordering

Would be nice if Zend could create somthing similar to this that binds
in with the framework

Ian


Brian Caspe wrote:
 I've had a question about this too, though specifically it doesn't
 really deal with pulling one book. I was wondering what solutions
 people have for wanting to pull a set of books (to use the earlier
 example) from a category (say, biography) and then limit the list (for
 paging).

 I had guessed that the solution would be to get the relevant category
 row, then pull all the books for that category, (findManyToManyRowset)
 but there doesn't seem to be a clean way to limit the books. I'm most
 likely missing something.

 brian




Re: [fw-general] Temperature conversions

2007-07-11 Thread Thomas Weidner

The translation maths are from onlineconversions.com...
I could hardly believe that they would not see this sort of failure in their 
data because they are there since several years and were one of the first.


Maths:
1 Celsius equals 274,15 Kelvin
1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin
I see no failure here.
And the standard unit has no  included...

Sorry, but I dont see any problem on the mentioned lines.

To say it once more for all...
We can not expect what you mean...
We are no clairvoyants...

PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION 

Greetings
Thomas
I18N Team Leader

- Original Message - 
From: Belmin Fernandez [EMAIL PROTECTED]

To: fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 2:41 PM
Subject: [fw-general] Temperature conversions


I was trying out the temperature conversions and I realized I was
getting the wrong values. I looked at Zend/Measure/Temperature.php and
it seems the math is incorrect. Currently:

   'CELSIUS'= array(array('' = 1, '+' = 274.15),'°C'),
   'FAHRENHEIT' = array(array('' = 1, '-' = 32, '/' = 1.8,
'+' = 273.15),'°F'),

Should be:

   'CELSIUS'= array(array('' = 1, '+' = 273.15),'°C'),
   'FAHRENHEIT' = array(array('' = 1, '+' = 459.67, '/' = 9,
'*' = 5 ),'°F'),

I am incorrect about this? I'm assuming I'm missing something or
atleast doubt I'm the first person to catch it.

--Belmin 



Re: [fw-general] header and footer

2007-07-11 Thread Pádraic Brady
Hi Paulo,

From: Paulo Nei [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 3:50:51 PM
Subject: Re: [fw-general] header and footer




  
  

Thank you. Now it is more clear...



Hope ZF will adopt standard ways to do this. I was seeking for
something like Tiles (Java), that is commonly used with Struts; or like
layouts in Ruby on Rails (that are based on naming conventions).



Regards,

Paulo

Zend_View Enhanced's implementation of Layouts and Placeholders is a template 
based approach which works a little like the Tiles tag library in Jakarta. It's 
still a bit like comparing Apples and Oranges given the implementation 
differences, but the use of Placeholders in ZVE allows for some similar 
effects to Tiles - see the use cases on Layouts in my proposal (pretty simple 
use cases but the potential is there for more intricate uses).

If ZVE layouts are adopted I'd be more comfortable allowing for some more 
intricate usage of Placeholders to provide a more Tiles-like system for those 
familiar with how it works in Struts. For now ZVE has a more simple minded 
approach where everything is declared within templates, and not much up-front 
declaration as you'd normally see if using the Tiles :insert tag.

Best regards,
Paddy
 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com









 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

Re: [fw-general] Release Schedule

2007-07-11 Thread Ralph Schindler
Hey Paddy, I have time for this now, perhaps it would be good to start 
getting out thoughts on there?  Ill go first (if the wiki is up) ;)


Pádraic Brady wrote:

Hi Mark,

When I checked it last, Ralph had yet to post a response there. If he 
does, and assuming the Wiki is up of course ;), I'll post another 
response and set a second question.


Paddy
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Mark [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 9:37:13 AM
Subject: Re: [fw-general] Release Schedule

Is this still happening?

http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS+Zend_Layout+Throwdown

I've never been to a Throwdown. Of course it's on the Wiki so right now I
can't check it.

Regards,
Mark

On Wednesday 11 July 2007 08:54, Pádraic Brady wrote:
  Hi,
 
  Just to clarify what Layout means? - I'm being told elsewhere that
  Zend_Layout is being accepted but I assume there's no proposal acceptance
  yet. I mean we have three varying methods of doing layouts - Zend_View
  Enhanced, Zend_Layout, and Matthew's Two-Step View - which differ 
primarily
  in how and where in the V and C they are executed. It got lost a 
while back

  in all the noise generated by the debate between me and Ralph which ended
  rather abruptly on the list but I'd like to see some consideration 
towards

  implementing both. The reasoning is simple enough - both are
  non-conflicting methods and each facilitates a preferred MVC practice in
  the community. Both current proposals are also not equal in scope and 
goals

  - another point seemingly lost is that Layouts is just one part of
  Zend_View Enhanced proposes.
 
  Those of us preferring View Helpers for reading Models into a View would
  usually prefer a simpler decorator approach in Zend_View that leaves the
  Controller out of the equation - we don't really want to be forced to 
use a

  multiple Controllers in place of a simple 25 line decorator nor to return
  to the status quo where we have to subclass Zend_View, adopt a Two-Step
  View (another custom plugin) or just take a leap and replace it 
altogether.

 
  Contrary to the growing belief, both Layout strategies shouldn't be
  considered as being in competition. I said very early on that 
implementing
  both could be a major plus to the community, and this should be given 
some

  weight going forward.
 
  Kind regards,
  Paddy
 
  Pádraic Brady
  http://blog.astrumfutura.com
  http://www.patternsforphp.com
 
 
  - Original Message 
  From: Aaron D. Campbell [EMAIL PROTECTED]
  To: fw-general@lists.zend.com
  Sent: Monday, July 9, 2007 11:05:35 PM
  Subject: [fw-general] Release Schedule
 
  I see the roadmap, with some of the future things to be implemented in
  ZF, but is there a release schedule?  Specifically I'd like to see when
  Zend_Layout is coming out.  I was told it would be included in 1.1, but
  when is that due out?
 
 
 
 
 
 
 
   
  
___

 _ Park yourself in front of a world of choices in alternative
  vehicles. Visit the Yahoo! Auto Green Center.
  http://autos.yahoo.com/green_center/




Get the Yahoo! toolbar and be alerted to new email 
http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.phpwherever 
you're surfing.




Re: [fw-general] Release Schedule

2007-07-11 Thread Ralph Schindler
No, I don't see Zend_Layout as accepted as is, and I have not been told 
that.  In all truthfulness, I've expressed a concern to Matthew that the 
development of such component, be it spearheaded by a community member 
or not, be completely visible to the community as much as possible 
throughout the process.


It can be argued that both proposals have merits. In fact, I didnt fully 
appreciate the use of partials until I saw your implementation, as an 
example.


At the end of the day, I think it can be said that we all want the best 
solution.  And in finding the best solution, we need to identify where 
this solution will exist, be it a Composite component in the top level 
pseudo-namespace, or as a hard coupled feature of an existing 
component (like the view or the controller, andi mentioned 
Zend_View_Layout).  Whatever the answer, it needs to be scale-able and 
flexible, and also not loose sight that this framework can AND WILL be 
used in more environments than just the Web/http.


preferred MVC practice in the community. Both current proposals are also 
not equal in scope and goals - another point seemingly lost is that 
Layouts is just one part of Zend_View Enhanced proposes.


I am hoping this is addressed in the development process.

Contrary to the growing belief, both Layout strategies shouldn't be 
considered as being in competition. I said very early on that 
implementing both could be a major plus to the community, and this 
should be given some weight going forward.


I actually kinda agree here. BTW.

If both implementations were to be implemented, there would have to be a 
very clear and consise guide to deciding which to use and when, as YES, 
they both do suit semi-overlapping but different needs.




-ralph


Re: [fw-general] Release Schedule

2007-07-11 Thread Pádraic Brady
Hi Ralph,

Fire away ;), I'll be back online this evening and can likely post a response. 
The wiki is up for now - how long that lasts is hard to say... Ralph vs 
Confluence!

Paddy
 
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com


- Original Message 
From: Ralph Schindler [EMAIL PROTECTED]
To: Pádraic Brady [EMAIL PROTECTED]
Cc: Mark [EMAIL PROTECTED]; Zend Framework General fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 4:50:06 PM
Subject: Re: [fw-general] Release Schedule

Hey Paddy, I have time for this now, perhaps it would be good to start 
getting out thoughts on there?  Ill go first (if the wiki is up) ;)

Pádraic Brady wrote:
 Hi Mark,
 
 When I checked it last, Ralph had yet to post a response there. If he 
 does, and assuming the Wiki is up of course ;), I'll post another 
 response and set a second question.
 
 Paddy
  
 Pádraic Brady
 http://blog.astrumfutura.com
 http://www.patternsforphp.com
 
 
 - Original Message 
 From: Mark [EMAIL PROTECTED]
 To: fw-general@lists.zend.com
 Sent: Wednesday, July 11, 2007 9:37:13 AM
 Subject: Re: [fw-general] Release Schedule
 
 Is this still happening?
 
 http://framework.zend.com/wiki/display/ZFDEV/Zend_View+Enhancement+VS+Zend_Layout+Throwdown
 
 I've never been to a Throwdown. Of course it's on the Wiki so right now I
 can't check it.
 
 Regards,
 Mark
 
 On Wednesday 11 July 2007 08:54, Pádraic Brady wrote:
   Hi,
  
   Just to clarify what Layout means? - I'm being told elsewhere that
   Zend_Layout is being accepted but I assume there's no proposal acceptance
   yet. I mean we have three varying methods of doing layouts - Zend_View
   Enhanced, Zend_Layout, and Matthew's Two-Step View - which differ 
 primarily
   in how and where in the V and C they are executed. It got lost a 
 while back
   in all the noise generated by the debate between me and Ralph which ended
   rather abruptly on the list but I'd like to see some consideration 
 towards
   implementing both. The reasoning is simple enough - both are
   non-conflicting methods and each facilitates a preferred MVC practice in
   the community. Both current proposals are also not equal in scope and 
 goals
   - another point seemingly lost is that Layouts is just one part of
   Zend_View Enhanced proposes.
  
   Those of us preferring View Helpers for reading Models into a View would
   usually prefer a simpler decorator approach in Zend_View that leaves the
   Controller out of the equation - we don't really want to be forced to 
 use a
   multiple Controllers in place of a simple 25 line decorator nor to return
   to the status quo where we have to subclass Zend_View, adopt a Two-Step
   View (another custom plugin) or just take a leap and replace it 
 altogether.
  
   Contrary to the growing belief, both Layout strategies shouldn't be
   considered as being in competition. I said very early on that 
 implementing
   both could be a major plus to the community, and this should be given 
 some
   weight going forward.
  
   Kind regards,
   Paddy
  
   Pádraic Brady
   http://blog.astrumfutura.com
   http://www.patternsforphp.com
  
  
   - Original Message 
   From: Aaron D. Campbell [EMAIL PROTECTED]
   To: fw-general@lists.zend.com
   Sent: Monday, July 9, 2007 11:05:35 PM
   Subject: [fw-general] Release Schedule
  
   I see the roadmap, with some of the future things to be implemented in
   ZF, but is there a release schedule?  Specifically I'd like to see when
   Zend_Layout is coming out.  I was told it would be included in 1.1, but
   when is that due out?
  
  
  
  
  
  
  

   
 ___
  _ Park yourself in front of a world of choices in alternative
   vehicles. Visit the Yahoo! Auto Green Center.
   http://autos.yahoo.com/green_center/
 
 
 
 
 Get the Yahoo! toolbar and be alerted to new email 
 http://us.rd.yahoo.com/evt=48225/*http://new.toolbar.yahoo.com/toolbar/features/mail/index.phpwherever
  
 you're surfing.








   

Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

[fw-general] RE: Bug in Zend_Mail?

2007-07-11 Thread mike55



Daniel Freudenberger wrote:
 
 Okay finally I think a solution should be very simple. Changing the line
 ending from lf to crlf in Zend_Mime solves the problem. I guess the php
 windows mail() function expects the content to use crlf as line ending?!
 

what exactly do you mean with Changing the line ending from lf to crlf in
Zend_Mime? changing it in the zend library itself? all instances of lf in
Zend_Mime?

i have similar problems which constantly lead to:

Fatal error: Uncaught exception 'Zend_Mail_Protocol_Exception' with message
'451 See http://pobox.com/~djb/docs/smtplf.html. ' in
D:\adat\awebsites\ev-manager\mvc-site\lib\Zend\Mail\Protocol\Abstract.php:351

the solution for setBodyText was, to change from quoted printable to
ENCODING_7BIT.
but as soon as i attach a picture with base64 or any other encoding, i get
the error.

 thanx
  mike
-- 
View this message in context: 
http://www.nabble.com/Bug-in-Zend_Mail--tf4004989s16154.html#a11544339
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Models, Objects and RDBMS - Best Practise

2007-07-11 Thread Dylan Arnold

Okay I ended up with something like this

Class My_Model
{
   private $_gateway;
   private $_gatewayClass;

   protected function gateway(){
   $this-_gateway = ($this-_gateway) ? $this-_gateway : new
$this-_gatewayClass();
   return $this-_gateway;
   }

   public function insert($data){
   $gateway = $this-gateway();
   $gateway-insert($data);
   }

   public function delete($where){
   $gateway = $this-gateway();
   $gateway-delete($where);
   }

   //other db_table functions such as insert and delete
}

class Category_Gateway extends Zend_Db_Table_Abstract
{
   protected $_name = 'categories';
}

Class Category extends My_Model
{
   protected $_gatewayClass = 'Category_Gateway';

   public function someSpecialFunction($column){
   //special queries
   }

}

Then of course I can do stuff like this

$category = new Category();
$category-insert($someArray);
$category-someSpecialFunction($someColumn);

Haven't tested the above. What I have is close to that though. Anything
seriously wrong?

On 7/12/07, Dylan Arnold [EMAIL PROTECTED] wrote:


I started following the gateway() approach then read the next posts.

I'm thinking about making a model class and extending my models from that.

The model class will have all the db_table methods like insert, update
etc.

My models will then all extend from the model class so that they have all
the original table methods available. In the constructor or some init method
or something they will set the corresponding db_table object for use.


On 7/12/07, Ian Warner [EMAIL PROTECTED] wrote:

 I create my models, and then spit the data to a View Helper called Table
 Render

 This table render utilises PEAR Structures so I can expose the data in
 many different ways, including an HTML table, CSV, XML, Excel, PDF etc.

 Just another abstraction layer to help with reporting, it also does
 paging, filtering and header ordering

 Would be nice if Zend could create somthing similar to this that binds
 in with the framework

 Ian


 Brian Caspe wrote:
  I've had a question about this too, though specifically it doesn't
  really deal with pulling one book. I was wondering what solutions
  people have for wanting to pull a set of books (to use the earlier
  example) from a category (say, biography) and then limit the list (for
  paging).
 
  I had guessed that the solution would be to get the relevant category
  row, then pull all the books for that category, (findManyToManyRowset)

  but there doesn't seem to be a clean way to limit the books. I'm most
  likely missing something.
 
  brian
 





Re: [fw-general] header and footer

2007-07-11 Thread Matthew Weier O'Phinney
-- Paulo Nei [EMAIL PROTECTED] wrote
(on Wednesday, 11 July 2007, 11:50 AM -0300):
 Hope ZF will adopt standard ways to do this. I was seeking for
 something like Tiles (Java), that is commonly used with Struts; or
 like layouts in Ruby on Rails (that are based on naming conventions).

Layout support of one sort or another is scheduled for 1.1.0. Please
subscribe to fw-mvc if you are interested so you can view announcements
regarding the progress, and hopefully test it out during development!


 Rob Allen escreveu:
 
 Paulo Nei wrote:
 
 
 Hi,
 
 I wanna put header  footer in all view templates.
 
 But with ZF I don't got an easy way to do it:
 
 
 
 
 You need what's generally known as a Two Step view. There are multiple
 ways to do it:
 
 1. Front Controller plugin.
 http://www.nabble.com/Controller-and-View-Question-tf3462561.html
 
 2. Zend_Layout proposal.
 http://framework.zend.com/wiki/display/ZFPROP/Zend_Layout
 
 3. Zend_View Enhanced proposal.
 http://framework.zend.com/wiki/pages/viewpage.action?pageId=33071
 
 4. Extend ViewRenderer directly.
 http://akrabat.com/2007/06/02/extending-viewrenderer-for-layouts/
 
 
 The wiki is down again, so I could have got the links to 2 and 3 wrong!
 
 
 Regards,
 
 Rob...
 
 
 
 

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


Re: [fw-general] Temperature conversions

2007-07-11 Thread Belmin Fernandez

But according to the 'Temperature.php' library

1 C = 275,15 K
1F = -1.7E+25 K (as oppose to onlineconversions.com that
says 255.92778 K)

Again, I might be missing something but that is what I'm getting.
Should I post code? Maybe I'm doing it incorrectly. Can someone else
test this?

On 7/11/07, Thomas Weidner [EMAIL PROTECTED] wrote:

The translation maths are from onlineconversions.com...
I could hardly believe that they would not see this sort of failure in their
data because they are there since several years and were one of the first.

Maths:
1 Celsius equals 274,15 Kelvin
1 Fahrenheit equals (-32/1.8) + 273,15 Kelvin
I see no failure here.
And the standard unit has no  included...

Sorry, but I dont see any problem on the mentioned lines.

To say it once more for all...
We can not expect what you mean...
We are no clairvoyants...

PLEASE PROVIDE ENOUGH DATA FOR REPRODUCTION 

Greetings
Thomas
I18N Team Leader

- Original Message -
From: Belmin Fernandez [EMAIL PROTECTED]
To: fw-general@lists.zend.com
Sent: Wednesday, July 11, 2007 2:41 PM
Subject: [fw-general] Temperature conversions


I was trying out the temperature conversions and I realized I was
getting the wrong values. I looked at Zend/Measure/Temperature.php and
it seems the math is incorrect. Currently:

'CELSIUS'= array(array('' = 1, '+' = 274.15),'°C'),
'FAHRENHEIT' = array(array('' = 1, '-' = 32, '/' = 1.8,
'+' = 273.15),'°F'),

Should be:

'CELSIUS'= array(array('' = 1, '+' = 273.15),'°C'),
'FAHRENHEIT' = array(array('' = 1, '+' = 459.67, '/' = 9,
'*' = 5 ),'°F'),

I am incorrect about this? I'm assuming I'm missing something or
atleast doubt I'm the first person to catch it.

--Belmin




Re: [fw-general] view auto quoting

2007-07-11 Thread Matthew Weier O'Phinney
-- Kai Meder [EMAIL PROTECTED] wrote
(on Wednesday, 11 July 2007, 10:13 PM +0200):
 does the view/view-helper do quoting automatically?

No, though there is a facility to do so by registering filters.

 view-helper.php
 ?php
 class Zend_View_Helper_JsConstant {
 
 public function jsConstant($name, $value) {
   
 echo 'script type=text/javascriptvar ' . $name . ' = ' . 
 Zend_Json::encode($value).';/script' . \n;
 }
 }
 
 the value is printed with quotes and the json-quotes are escaped.
 any idea who does this quoting and where to turn it off?

Not happening in Zend_View, unless you're registering any filters with
the Zend_View object. It may be happening in Zend_Json::encode(), but it
should only be occurring if the value is a string.

How are you calling the helper? simply as:

? $this-jsConstant() ?

or are you wrapping it in escape():

?= $this-escape($this-jsConstant()) ?

If the latter (escape), then omit the call to escape().

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


[fw-general] Zend_Filter_Input and accessing values that is not validated

2007-07-11 Thread Bjarte Kalstveit Vebjørnsen

Hi all.

I am having troubles with the new Zend_Filter_Input.
It is quite possible that I've missed something obvious, but here is my 
problem.


?php
require_once 'Zend/Filter/Input.php';
$values = array(
   'test' = '22',
   'test2' = '22'
);

$filters = array('*'= 'Digits');

$validators = array('test2' = 'Digits');

$input = new Zend_Filter_Input($filters,  $validators, $values);

echo pre;
var_dump($input-test);
var_dump($input-test2);
echo /pre;
?

This gives me:

NULL
string(2) 22


How can I access the filtered value of test, without adding a validator 
for it?

(If I add test to the list of validators, it works).

Best regards,

Bjarte


[fw-general] Re: Zend_Filter_Input fields meta command with arrays problem

2007-07-11 Thread Joshua Ross
Guess I need to submit a bug report?  Noone has any thoughts?

Josh

Joshua Ross [EMAIL PROTECTED] wrote in 
message news:[EMAIL PROTECTED]

 Joshua Ross [EMAIL PROTECTED] wrote 
 in message news:[EMAIL PROTECTED]
I am having a problem with Zend_Filter_Input when attempting to validate 
an array of values using the fields meta command.  What happens is that 
ZFI passes the array of values to my filter which correctly returns true 
and then ZFI passes each value separately which fails.  Here is my 
code(simplified) pretty much straight from the doc:

 $validators = array('password_check' = array('StringEquals',
'presence' = 'required',
'fields' = array('password0', 'password1'));

 $input = new Zend_Filter_Input(array(), $validators, 
 $this-getRequest()-getPost());
 $input-addNamespace('Local_Validate');

 if (!$input-isValid()) {

 }

 What happens is StringEquals is called three times, once with an array, 
 and once with each string.  Some debug output dumping the value passed to 
 my StringEquals validator produces the following:

 array(2) {
  [password0] = string(9) Testing1!
  [password1] = string(9) Testing1!
 }

 string(9) Testing1!

 string(9) Testing1!


 So I looked into ZFI and it appears it handles arrays of fields (line 720 
 in ZF 1.0.0 v5344) but then it continues to evaluate all fields in the 
 data array *seperately* validating it against the current validator chain 
 which happens to be the validator StringEquals which only validates 
 arrays... which of course returns false.

 Basically, it appears either I am missing something or having the fields 
 meta command set to an array will not work if the validator validates 
 that the value is in fact an array.  Anyone else come across this? 
 Should my validator simply return true if the value is not an array?  I'm 
 not sure I care too much for that work around.  To me, if you pass the 
 fields meta command with an array value it should only validate the 
 array, not each seperately.  Any help is appreciated,
 Thanks
 Josh




 The following if stmt fixes the issue:
 // Added the below if check
 if (1 == count($validatorRule[self::FIELDS])) {
if (!$validatorRule[self::VALIDATOR_CHAIN]-isValid($value)) {
$this-_invalidMessages[$validatorRule[self::RULE]] = 
 $validatorRule[self::VALIDATOR_CHAIN]-getMessages();
$this-_invalidErrors[$validatorRule[self::RULE]] = 
 $validatorRule[self::VALIDATOR_CHAIN]-getErrors();
unset($this-_validFields[$fieldKey]);
$failed = true;
if ($validatorRule[self::BREAK_CHAIN]) {
return;
}
 }


 





Re: [fw-general] view auto quoting

2007-07-11 Thread Kai Meder

Matthew Weier O'Phinney wrote:

Not happening in Zend_View, unless you're registering any filters with
the Zend_View object. It may be happening in Zend_Json::encode(), but it
should only be occurring if the value is a string.
no filters registered at all. double-checked via 
var_dump($this-getFilters());



How are you calling the helper? simply as:

$this-roles is array from db-select
json() is kindof shortcut to Zend_Json::encode

?php $this-jsVar('ROLES', json($this-roles)); ?

which results in:
script type=text/javascriptvar ROLES = 
{\Writer\:{\role\:\Writer\}};/script


full helper-source:
?php
class Zend_View_Helper_JsVar {

public function jsVar($name, $value) {

echo 'script type=text/javascript';
echo 'var ' . $name . ' = ';
echo json($value);
echo ';';
echo '/script';
echo \n;
}
}

the whole thing is quoted twice and it seems to be the view's fault.
i have several ajax-controller which have no views and directly output 
the json-objects in the actionAction()-methods like so:

echo json($db-selected-stuff);
it works as expected.

in the view-script the output is messed/quoted up and i have *no* idea 
where to look for this strange behaviour.


any ideas?
kai



Re: [fw-general] view auto quoting

2007-07-11 Thread Kai Meder

it works when directly outputting in the view-script
*without* the helper like:

script type=text/javascript
var SNAME = ?php echo session_name(); ?;
var SID   = ?php echo session_id(); ?;

var ROLES = ?php echo json($this-roles); ?;
/script

yours,
kai


Re: [fw-general] Searching database

2007-07-11 Thread ViShap

Hi josé!

What kind of search should this be?  Full-Text or matching  (LIKE %$string%
) ?

For Like execute a simple Query  select . from . LIKE %$string%  limit ...

for full text i strongly recommend google-searching - many good articles
about it  =)
(i think also zend has sth in their tutorials-section ...

It was when I viewed it in  Beginner Tutorials - Using MySQL Full-text-
...  (26.01.06 ^^)

I hope i helped ya out!

regards

2007/7/11, José de Menezes Soares Neto [EMAIL PROTECTED]:


Hi friends,

I would like to make a search for search user details in my database, how
do I start with it?

Best regards,

José de Menezes



Re: [fw-general] Searching database

2007-07-11 Thread ViShap

oh ...  ;)

do a if(isset($_GET['query']) { .. make you search and display the results
} else {
show the question-form
}

regards

2007/7/11, José de Menezes Soares Neto [EMAIL PROTECTED]:


if a type http://localhost/search?query=123, its ok

but if I type http://localhost/search it shows a notice undefined index



2007/7/11, José de Menezes Soares Neto [EMAIL PROTECTED]:

 i want matching...

 but i try to get $query = $_GET[query]

 and there appears a message:

 *Notice*: Undefined index: query in 
*C:\www\was\application\controllers\FuncionariosController.php
 * on line *81



 *
 2007/7/11, ViShap [EMAIL PROTECTED] :
 
  Hi josé!
 
  What kind of search should this be?  Full-Text or matching  (LIKE
  %$string% ) ?
 
  For Like execute a simple Query  select . from . LIKE %$string%  limit
  ...
 
  for full text i strongly recommend google-searching - many good
  articles about it  =)
  (i think also zend has sth in their tutorials-section ...
 
  It was when I viewed it in  Beginner Tutorials - Using MySQL
  Full-text- ...  (26.01.06 ^^)
 
  I hope i helped ya out!
 
  regards
 
  2007/7/11, José de Menezes Soares Neto [EMAIL PROTECTED]:
  
   Hi friends,
  
   I would like to make a search for search user details in my
   database, how do I start with it?
  
   Best regards,
  
   José de Menezes
  
 
 




[fw-general] consultants?

2007-07-11 Thread Hoopes

Hi guys,

Apologies in advance if this is not the place for this type of message, 
feel free to delete it if so.


My company is making a move from old code to a more framework oriented, 
standardized solution. (We'd like to bring in outside help, and our 
non-standard way of doing things takes more time to spin them up than 
get the work done). So, we're attempting to move to the ZF so hopefully 
the MVC-ness of it will allow people to come in and contribute more easily.


So, we're actually looking for someone to come to the office, and teach 
us a bit to get us started on this.
Specifically the Model part of the MVC, but overall education is the 
goal. :)


We're a Pittsburgh based company, and if anyone reading this has some 
time (and patience), and wants to try to make some money, please email 
[EMAIL PROTECTED] with any inquiries for further information.


Thanks
- hoopes


Re: [fw-general] view auto quoting

2007-07-11 Thread yahiko myojin

Hi,

Kai Meder wrote:

$this-roles is array from db-select
json() is kindof shortcut to Zend_Json::encode

?php $this-jsVar('ROLES', json($this-roles)); ?

which results in:
script type=text/javascriptvar ROLES = 
{\Writer\:{\role\:\Writer\}};/script


full helper-source:
?php
class Zend_View_Helper_JsVar {

public function jsVar($name, $value) {
   
echo 'script type=text/javascript';

echo 'var ' . $name . ' = ';
echo json($value);
echo ';';
echo '/script';
echo \n;
}
}

the whole thing is quoted twice and it seems to be the view's fault.

in the call to $this-jsVar you pass a JSON encoded value, which is a 
string.
In the helper function you encode the $value a second time, hence the 
escaped string.

Removing one off the json() call's will fix it.

Kind regards
Stefan


Re: [fw-general] consultants?

2007-07-11 Thread ViShap

a quick tip:
1.
use google and inform about MVC  -  there is a big amout of articles about
it - and they are really good.

2.
read the manuals of Zend Framework  -  they are (in most cases ;) ) very
infomrative!

3.
look at tutorials like the one from akrabat.com or the other ones listed and
linked in the Debelopment-area of the zf-webpage!

4.
read a little bit into the code and the start is very very easy  =)

regards

2007/7/11, Hoopes [EMAIL PROTECTED]:


Hi guys,

Apologies in advance if this is not the place for this type of message,
feel free to delete it if so.

My company is making a move from old code to a more framework oriented,
standardized solution. (We'd like to bring in outside help, and our
non-standard way of doing things takes more time to spin them up than
get the work done). So, we're attempting to move to the ZF so hopefully
the MVC-ness of it will allow people to come in and contribute more
easily.

So, we're actually looking for someone to come to the office, and teach
us a bit to get us started on this.
Specifically the Model part of the MVC, but overall education is the
goal. :)

We're a Pittsburgh based company, and if anyone reading this has some
time (and patience), and wants to try to make some money, please email
[EMAIL PROTECTED] with any inquiries for further information.

Thanks
- hoopes



[fw-general] fw-all list broken?

2007-07-11 Thread Jack Sleight

Hi,
I am subscribed to fw-general, fw-announce and fw-all, but I only 
receive emails from general and announce, even though there are messages 
being posted in the other mailing lists that should be covered by 
fw-all. Anyone know why?

Thanks,
--
Jack


Re: [fw-general] consultants?

2007-07-11 Thread ViShap

I think, if your system is running and you won´t change the database (Mysql
to oracle for ex) the Database-Models are not needed (thats what I think  ;)
)

As Bill said, if you need someone doing things for you or supporting your
start, the jobs-offers @ zend-page will be a good start!
Otherwise:  study the manual, read some code, look at the forums and
maillists to read into the framework.
AND:  ASK!  We are helping new interested people - for sure  =)
But say what concrete problem you have and we can solve it  =)

also its a good idea to search the nabble-pages for already asked
questeions!

me and myself - can´t even think about doing this job for you ... I have
work for 2 months 24/7 here at my list ...  sry  ;)

regards


Re: [fw-general] fw-all list broken?

2007-07-11 Thread Aaron D. Campbell
No, but I have the same problem.  I subscribed to fw-mvc separately, 
just so I didn't miss anything there...Do we just need to sign up for 
everything separately?


Jack Sleight wrote:

Hi,
I am subscribed to fw-general, fw-announce and fw-all, but I only 
receive emails from general and announce, even though there are 
messages being posted in the other mailing lists that should be 
covered by fw-all. Anyone know why?

Thanks,


[fw-general] Session data getting erased on another page

2007-07-11 Thread Matt Needles

I am seeing a strange behavior using zend session. Here is what I have in my
bootstrap:

require( 'Zend/Session.php' );
Zend_Session::start();

On the login page, I am storing user-id in session (my own implementation,
not using zend-auth):

$_SESSION[ 'auth' ][ 'user' ] = $id;

I can print_r the session on the login page and see the value is assigned.
On surfing to another page, I see the value assigned to session-auth-user
above is gone and the page is getting redirected to the login page again.
What am i doing worng?

Thanks,

matt


[fw-general] Tutorial on session/auth/acl

2007-07-11 Thread Matt Needles

I could not find a tutorial that integrates session/auth/acl. The manual in
alphabetic is not that useful. Somebody please send me a link to any
tutorials.