Re: [fw-general] How do I use Zend_Paginator without MVC ?

2009-04-29 Thread Shaun Rowe

benjw wrote:

How do I display/render the Paginator controls when I'm not using a view
script/partial?

There are no examples anywhere and I can't figure it out.

Thanks,


You can use the output of $paginator->getPages() to access all the data 
you'd need to write your own pagination control without a view helper.


http://framework.zend.com/manual/en/zend.paginator.usage.html#zend.paginator.usage.rendering.properties


Regards

Shaun


Re: [fw-general] Nightly build system

2008-05-03 Thread Shaun Rowe

Matthew Weier O'Phinney wrote:

Honestly? Currently we use a shell script.

In the future, this will likely change. We're evaluating options for a
Continuous Integration server, and most likely whatever solution we
utilize for this will also generate the nightly builds.


I've had a lot of success using Trac with the Bitten Continuous 
Integration plugin. The build recipes have support for running 
executables, PHPUnit, phing and many other tools, so it's quite powerful.



Shaun



Re: [fw-general] .phtml files question

2008-02-07 Thread Shaun Rowe

Mauricio Cuenca wrote:

Well,

I have this my bootstrap file:

require_once 'Zend/Controller/Front.php';
Zend_Controller_Front::run('/var/www/mauricio/application/controllers');
Zend_Controller_Front::setParam('noViewRenderer', true);

And I get the following error:

Fatal error: Using $this when not in object context in
/var/www/library/Zend/Controller/Front.php on line 634

I can not get this to work


Yeah, sorry. As I said before I read your message incorrectly so my 
advice was incorrect.



Cheers

Shaun


Re: [fw-general] .phtml files question

2008-02-07 Thread Shaun Rowe

Shaun Rowe wrote:
If you are using the ViewRenderer (default behaviour), in your action 
method add this line of code.


$this->_helper->viewRenderer->setNoRender();



Cheers

Shaun


That was completely wrong after re-reading the message. Ignore me.


Cheers

Shaun



Re: [fw-general] .phtml files question

2008-02-07 Thread Shaun Rowe

Mauricio Cuenca wrote:

Hello,

What do I have to do to not require those files and keep using my Zend_View
templates?

Thanks!


If you are using the ViewRenderer (default behaviour), in your action 
method add this line of code.


$this->_helper->viewRenderer->setNoRender();



Cheers

Shaun



Re: [fw-general] ~user in url

2008-01-04 Thread Shaun Rowe

iffy guy wrote:

hi,

How can i have controller ignore the ~user in the url:
http://loalhost/~user/module/controller/action/. 
..




You can use the setBaseUrl method in Zend_Controller_Front;

$front = Zend_Controller_Front::getInstance();
$front->setBaseUrl('http://loalhost/~user/');


Cheers

Shaun


[fw-general] CLA question

2007-12-10 Thread Shaun Rowe

Hi There,

I have a corporate CLA and I have since left that position. Is it 
possible to convert my CLA to a personal one? Or will I have to re-apply?



Many Thanks

Shaun


Re: [fw-general] Config-driven framework components

2007-07-26 Thread Shaun Rowe

Ralph Schindler wrote:

>
> -ralph


I'd be very keen to help out with this too. I've been working on an 
article for a while, trying to write an ini/xml config for 
Zend_Filter_Input.


I'll eventually release it to the wild but I have to finish my personal 
site first.



Cheers

Shaun


Re: [fw-general] Working with Paths

2007-06-28 Thread Shaun Rowe

[EMAIL PROTECTED] wrote:

Hello,

I'm not currently using Zend Framework although I'm observing it's 
evolution waiting for the final release and studying its applicability 
into my projects.


One thing that poped into my mind lately is how I should deal with paths 
within Zend Framework. Is there any built in solution for this? For this 
I mean a way to reference the application base directory and define 
other key directories to be used in the code instead of writing the path 
everytime.


I'm used to create constants to define paths. What about Zend Framework? 
What about modules that have they own javascript and css files for 
instance? How should I organize them?


Thank you,
Luiz


I think you should take a look at the Zend_Config component. It would 
definitely serve your needs.


http://framework.zend.com/manual/en/zend.config.html


Cheers

Shaun



Re: [fw-general] Deployment dependent code

2007-06-25 Thread Shaun Rowe

Matthew Weier O'Phinney wrote:

-- Stephan Stapel <[EMAIL PROTECTED]> wrote
(on Monday, 25 June 2007, 05:27 PM +0200):
I guess a lot of you have the problem to have code that is used within 
multiple environments, a (local) environment for development, another 
for testing and a third for production.


Usually, some things like database configuration differ between these 
environments. I was asking myself if anyone has a smart solution for a 
flexible configuration such that no additional files have to be renamed/ 
moved when deploying.


If someone has a good solution, would he/she like to share it?


Look through the Zend_Config documentation. Zend_Config has concepts of
both sections and inheritance, allowing you to create config files that
can be used in multiple contexts, or with contents that will differ
based on situation data. In particular, look at the Zend_Config_Ini
docs, http://framework.zend.com/manual/en/zend.config.adapters.ini.html,
which shows an example of production vs. staging configurations for a
database adapter.


Took the words right out of my mouth! But yes, what Matthew says is 
correct. I have developed several sites using the ZF and this type of 
configuration.



Cheers

Shaun



Re: [fw-general] Is there a way to disable "echo", "print" inside a method

2007-06-12 Thread Shaun Rowe

Matthew Weier O'Phinney wrote:

Well, for many releases now, we've had the dispatcher wrapping the
dispatched action with output buffering, so it's all being trapped in
the response object already. It's not a good practice, however, to echo
directly and rely on this. 


Probably the best way to get them out of the habit is through education.
Stick an echo into a library somewhere that you know they'll use, and
see if they can figure out what happened -- and then point out why what
they're doing is no better.



Now that's what I call geurila programming! :p


Shaun



Re: [fw-general] Is there a way to disable "echo", "print" inside a method

2007-06-12 Thread Shaun Rowe

depace wrote:
This sounds little stupid but if it is possible then it will save my ass 
being skinned..


the problem is while working in a team... the programmers instead of 
displaying the data through template they have a habit of echoing from 
the method itself...

have to trace where are all those crazy echosss .
so it has been a lil pain in ass ...

it really is a pain to make people work in MVC .. dunno why is it so 
hard for people to understand it..


Dude, tell them to stop doing that, there is no need! If they really 
wanna see something get them to log it with Zend_Log. No need for you to 
bend over backwards to accommodate them.


Go teach them the ways of changes. If they're not willing to compromise, 
there's point going down the MVC route...well there is but it'll be more 
painful than necessary.



Shaun


Re: [fw-general] ZEND_FORM dead?

2007-06-10 Thread Shaun Rowe

Bill Karwin wrote:

I echo the statements of Andi and Matthew.  A Form-handling solution is
very important, but the implementation that existed in the incubator did
not meet our project standards.  There were no tests, no documentation,
and there was no one working on it.

So after discussing with Andi, I moved the old "ZForm" code out of the
incubator and into the Zend Framework Laboratory svn repository
(http://framework.zend.com/fisheye/browse/Zend_Framework_Laboratory/ZFor
m).

I look forward to collecting requirements and prototype ideas for a form
solution after ZF 1.0 is released.  Form-handling is a complex subject
and we should dedicate some attention and careful thought to it as we
design the solution.

Regards,
Bill Karwin



I'm very keen to help out as much as I can with this. I have developed a 
form handling solution with ZF (as have many other, I imagine), so I'm 
hoping I may have some useful input.



Cheers

Shaun


Re: FW: [fw-general] ViewRenderer Problems

2007-05-31 Thread Shaun Rowe

Shaun Rowe wrote:

Shawn McAllister wrote:

After all my bitching I got it to work just fine... So slap me with a
trout and call me a noob... I apologize for my previously stated
idiocracy.

-Shawn


Todays programme was brought to you today by the letters R. T. F. M. ;)


In all seriousness, as there have been a few breakages with 
Zend_Controller, would it be a good idea to make the docs for this 
subject a little more prominent?



Shaun



That should have read:

"In all seriousness, as there have been a few *BC* breakages with 
Zend_Controller, would it be a good idea to make the docs for this 
subject a little more prominent?"


Re: FW: [fw-general] ViewRenderer Problems

2007-05-31 Thread Shaun Rowe

Shawn McAllister wrote:

After all my bitching I got it to work just fine... So slap me with a
trout and call me a noob... I apologize for my previously stated
idiocracy.

-Shawn


Todays programme was brought to you today by the letters R. T. F. M. ;)


In all seriousness, as there have been a few breakages with 
Zend_Controller, would it be a good idea to make the docs for this 
subject a little more prominent?



Shaun



Re: [fw-general] noob needs help assigning vars to view

2007-05-31 Thread Shaun Rowe

till wrote:

On 5/31/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:

(...)
No need to grab the view. All you need is this:

public function indexAction()
{
$this->view->books = array('Pride and Prejudice','Das 
Kapital','Beyond Good and Evil');

}


Since when has $this->view been available? I remember I was looking
for something like that when we started (0.6).

Also, it seems like there are different variables available, like
$this->_request, $this->view - "_" always hints at private, or is
their any special meaning/naming convention here?

Thanks,
Till


To coin a phrase, RT*M :)

There have been several changes in the Controller/View coupling since 
the 0.6 release.




From < 0.60

http://framework.zend.com/manual/en/zend.controller.migration.html#zend.controller.migration.fromzerosix


From 0.92 > 0.93

http://framework.zend.com/manual/en/zend.controller.migration.html#zend.controller.migration.fromzeroninetwo


From 0.93 >

http://framework.zend.com/manual/en/zend.controller.migration.html#zend.controller.migration.fromzeroninethree


Shaun


Re: FW: [fw-general] ViewRenderer Problems

2007-05-31 Thread Shaun Rowe

Shawn McAllister wrote:

Honestly, I didn't have a choice in the matter... If I did I probably
would have chosen a different framework. I was directed to use it... At
this point I will say that I have become accustomed to using it now...
And enjoy many of it's great features... My sole point is that I don't
really see the point in the changes to how views are rendered... And I
am bummed that in order to upgrade I will have to rewrite a significant
part of what I have been working on since .6 release when I read on
multiple occasions that no new features would be introduced in 1.0 after
around .9 release.

Shawn


Right ok sure. In that case as Padraic has pointed out, the ViewRenderer 
Action Helper can be turned off in the bootstrap, that *should* relieve 
your woes.



Shaun


Re: FW: [fw-general] ViewRenderer Problems

2007-05-31 Thread Shaun Rowe

Shaun Rowe wrote:

Shawn McAllister wrote:
 


In my opinion... The changes that have been made are idiotic to say the
least... The main motivation for using ZF was that it allowed for a lot
of flexibility... Now you have introduced the very thing I hate about
frameworks in general... Strict adherence to your view of development
methods and structure... Honestly, I am quite pissed that I now have to
go back and rewrite a lot of what I have written... I was quite
convinced that 1.0 would present itself as backward compatible... But
this new ViewRenderer bullshit just wasted a lot of my time if I choose
to upgrade... Which I must. I almost feel like I should have gone with
symfony now... Because the reasons I had for not using it are now
rearing their ugly heads in 1.0RC1.

-Shawn


To be fair mate, if you're building such important apps on a framework 
that's still in pre-release you only have yourself to blame. Then again 
you could point the finger at Zend for releasing ZF before 1.0, but 
that's hardly fair.


Anyone else wanna play the blame game?


Shaun


That was probably a bit harsh. Sorry.


Shaun


Re: FW: [fw-general] ViewRenderer Problems

2007-05-31 Thread Shaun Rowe

Shawn McAllister wrote:
 


In my opinion... The changes that have been made are idiotic to say the
least... The main motivation for using ZF was that it allowed for a lot
of flexibility... Now you have introduced the very thing I hate about
frameworks in general... Strict adherence to your view of development
methods and structure... Honestly, I am quite pissed that I now have to
go back and rewrite a lot of what I have written... I was quite
convinced that 1.0 would present itself as backward compatible... But
this new ViewRenderer bullshit just wasted a lot of my time if I choose
to upgrade... Which I must. I almost feel like I should have gone with
symfony now... Because the reasons I had for not using it are now
rearing their ugly heads in 1.0RC1.

-Shawn


To be fair mate, if you're building such important apps on a framework 
that's still in pre-release you only have yourself to blame. Then again 
you could point the finger at Zend for releasing ZF before 1.0, but 
that's hardly fair.


Anyone else wanna play the blame game?


Shaun


Re: [fw-general] Zend_Filter_Input::getEscaped()

2007-05-30 Thread Shaun Rowe

Bill Karwin wrote:

-Original Message-
From: Shaun Rowe [mailto:[EMAIL PROTECTED] 

Now all I have to do is refactor my code a bit to use this 
component and I'm laughing. As mine is already configured via 
an xml document, I reckon the config for Zend_Filter_Input 
can be described a similar way and held in a Zend_Config 
object. Would anyone be interested in how I get on?


That's great!  Yes, the idea was to make the rules declared as data, so
one could easily store it in one of the Zend_Config back-ends.

Would you consider writing an article for DevZone with your solution?
They're always looking for good ZF content.

Regards,
Bill Karwin


Yes, I'd be very interested in writing an article. Are you referring to 
my existing solution? Or to my (impending) refactoring? Or both? :)



Cheers

Shaun


Re: [fw-general] Zend_Filter_Input::getEscaped()

2007-05-30 Thread Shaun Rowe

Bill Karwin wrote:

Zend_Filter_Input is in core now.
 
The purpose of requiring getUnescaped() to be called explicitly is to 
force the application developer to acknowledge the fact that the value 
is in a form that is potentially not safe to output.
 
And yes, you can subclass Zend_Filter_Input and redefine its __get() 
method if you want to.
 
Alternatively, you can set the Zend_Filter_Input escape filter to 
something else:
 
  $input = new Zend_Filter_Input( ... );

  $input->setDefaultEscapeFilter('StringTrim'); // for example
 
Regards,

Bill Karwin


I have to say a big thanks to everyone who has worked on the re-design 
of Zend_Filter_Input. Having developed something quite similar myself 
using the ZF I'm pleased to see it now in the core.


Now all I have to do is refactor my code a bit to use this component and 
I'm laughing. As mine is already configured via an xml document, I 
reckon the config for Zend_Filter_Input can be described a similar way 
and held in a Zend_Config object. Would anyone be interested in how I 
get on?



Cheers

Shaun


Re: [fw-general] "Invalid controller specified (error)"

2007-05-30 Thread Shaun Rowe

Alexander Jaeger wrote:

Hello List,

yesterday i made an upgrade to 1.0 RC1

and i get this message "Invalid controller specified (error)".

I am sure it has something to do with my bootstrap file, but i can?t 
find a reason.


Can anyone throw me a hint?

Alex


This is due to the new ErrorHandler plugin. The documentation explains 
it's usage.


http://framework.zend.com/manual/en/zend.controller.plugins.html#zend.controller.plugins.standard


Cheers

Shaun


Re: [fw-general] Checking registry entries in index.php for efficiency and speed

2007-05-30 Thread Shaun Rowe

rcastley wrote:

Another quick question:

Do I need to check to see if registry entries are set in index.php for
efficiency or is this not required?

i.e.

Which is more efficient? (snippet from index.php)

if (!isset($registry->config)) {
$registry->config = new Zend_Config_Ini('.' . DS . 'application' . DS .
'config.ini', 'general');
}


or

$registry->config = new Zend_Config_Ini('.' . DS . 'application' . DS .
'config.ini', 'general');

My belief is that if I check to see if $registry->config is set then it
won't try and set it each time index.php is called.

Is this true?

Cheers,

- Robert


It is a good idea to check. An alternative to isset() would be to use 
the Zend_Registry::isRegistered() method;



Shaun





Re: [fw-general] I'm getting white space on the top of every page

2007-05-03 Thread Shaun Rowe

Shaun Rowe wrote:

mysticav wrote:
Every time an action is call from the controller, the result html 
comes with

white space at the top of the page
Start ---

   
   
   
---End--
The white space between the start and end is sent. Is there any 
problem with

the controller ?


Do you  have any whitespace after the closing ?> tag in your php files? 
If a php file contains nothing but php then you can omit the final 
closing ?> tag.



Shaun


Forgot to point out that whitespace after the ?> closing tag will be 
output. So that would be my first port of call.



Shaun



Re: [fw-general] I'm getting white space on the top of every page

2007-05-03 Thread Shaun Rowe

mysticav wrote:

Every time an action is call from the controller, the result html comes with
white space at the top of the page
Start ---




---End--
The white space between the start and end is sent. Is there any problem with
the controller ?


Do you  have any whitespace after the closing ?> tag in your php files? 
If a php file contains nothing but php then you can omit the final 
closing ?> tag.



Shaun


Re: [fw-general] my own classes

2007-04-25 Thread Shaun Rowe

James Andrews wrote:

> Because the previous developers put EVERYTHING in the htdocs directory.

> James

I think if we had been given a £100/$100 every time we saw this, we'd 
been very rich by now.



Shaun



Re: [fw-general] my own classes

2007-04-25 Thread Shaun Rowe

James Andrews wrote:

My project directory structures are usually something like this

/pathtoproject/htdocs <-  actual htdocs directory
/pathtoproject/classes   <-- class files I created that aren't in a library
/pathtoproject/lib<-- libraries and frameworks (usually my 
own, sometimes 3rd party)
/pathtoproject/include   <-- functions that are not OOP oriented and 
need somewhere to live
/pathtoproject/sql   <-- sql scripts to create the database 
structure.



I create a config.inc.php file in the htdocs directory that defines the 
SITEBASE constant as
define("SITEBASE",realpath(dirname(__FILE__).'/..));
Then in all files in the htdocs I 
require_once($_SERVER['DOCUMENT_ROOT'].'/config.inc.php');


If I need a class it's as simple as calling   
require_once(SITEBASE.'/classes//MyClass.class.php');


Now all my files except what need to be in the htdocs are safely kept 
outside of the document root where they can't easily be attacked.


James


That's a much better answer than mine! :)


Shaun


Re: [fw-general] my own classes

2007-04-25 Thread Shaun Rowe

José de Menezes Soares Neto wrote:

1) where in the project is the best place to put my on classes??

2) where in the project is the best place to call the classes??

3) some classes I will use a lot, there is a place to put them only once 
and use it in all files created?


I would consider maybe using Zend_Registry.


Shaun


[fw-general] Coding standards Zend_Http

2007-04-15 Thread Shaun Rowe

Hi there,

I've noticed a couple coding standards deviations within the Zend_Http 
component. Shall I go ahead and register a JIRA issue and attach my patch?



Kind Regards

Shaun Rowe


Re: [fw-general] Zend_Controller functionality...

2007-04-10 Thread Shaun Rowe

Alexander Netkachev wrote:

typo:
Zend_Controller_Front::getInstance()->getRouter()->addRoute('RouteName', 
new Zend_Controller_Router_Route('/dir1/:parameterName', array('action' 
=> 'action', 'controller' => 'dir1')));


Damn! Beat me to it, I'd just written a very similar reply. Hehe.


Shaun


Re: [fw-general] How to create feed with Zend_Feed_Rss ?

2007-04-05 Thread Shaun Rowe

Joe Kramer wrote:

Hi,

I am reading documentation and there's only examples how to READ feeds
but not how to CREATE.
I can't find any reference to creating feeds. I can instance
Zend_Feed_Rss, but how to add EntryRss to Feed?
Can anyone help? (If Zend_Feed is only about READING feeds, then
classes should be called Zend Feed_Reader. Otherwise it's confusing.)

Thanks.
Joe.


Hi Joe,

You might find this quite useful. It's related to Atom but has details 
regarding RSS.


http://devzone.zend.com/node/view/id/1889


Shaun


Re: [fw-general] CLA procesing time?

2007-03-22 Thread Shaun Rowe

Jack Sleight wrote:
Hi, 
I was just wondering how long it takes to process the CLAs? I submitted mine

a couple of days ago and not heard anything yet.

Cheers, 
Jack


I'd also like to ask the same question. Although I'm not trying to rush 
anyone along.



Many Thanks

Shaun Rowe