Quantcast

zf2-tutorial

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

zf2-tutorial

Enrico Zimuel-2
Hi all,

as you know we forked the zf2-tutorial application of Rob Allen
(akrabat) in our official repository:
https://github.com/zendframework/zf2-tutorial/.
The idea is to provide an example of how to build a simple web
application using the MVC of ZF2 and the most common components, like
Zend\Db.

The zf2-tutorial application is a simple CRUD that uses a MySQL
database. It shows how to implement a Module in ZF2 and how to use the
Zend\Db to interact with a simple table.
The idea is to use this application as example and explain the details
in the "Getting started" section of the Programmer’s Reference of ZF2:
http://zf2.readthedocs.org/en/latest/user-guide/overview.html

Yesterday I sent a PR to the zf2-tutorial repository adding the language
select box on the header page:
https://github.com/zendframework/zf2-tutorial/pull/1

With this PR we can show how to implement a simple language button to
switch the language on the fly. I used the Zend\Session to store the
language chosen. The internationalization support was already
implemented using the Zend\I18n component.

The idea is to add other features to the zf2-tutorial application.
Because this is a tutorial application I think we need to show how to
use the most common ZF2 components such as:
- Zend\Paginator
- Zend\Navigation
- Zend\Form (using annotation)
- View helper (creation/registration)

I'm working on the Zend\Paginator and Zend\Navigation.

Other ideas, feedbacks, comments?


--
Enrico Zimuel
Senior PHP Engineer     | [hidden email]
Zend Framework Team     | http://framework.zend.com
Zend Technologies Ltd.
http://www.zend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Artur Bodera
On Wed, Aug 8, 2012 at 10:49 AM, Enrico Zimuel <[hidden email]> wrote:
I'm working on the Zend\Paginator and Zend\Navigation.
 Other ideas, feedbacks, comments?

Is it based on the same tutorial that now sits in docs ? 

I can add Console support to the tutorial and tutorial app.


-- 
      __
     /.)\   +48 695 600 936
     \(./   [hidden email]




 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Enrico Zimuel-2
Hi Artur,

On 08/08/2012 11:14 AM, Artur Bodera wrote:
> On Wed, Aug 8, 2012 at 10:49 AM, Enrico Zimuel <[hidden email]> wrote:
>
>> I'm working on the Zend\Paginator and Zend\Navigation.
>>  Other ideas, feedbacks, comments?
>>
>
> Is it based on the same tutorial that now sits in docs ?
> http://zf2.readthedocs.org/en/latest/user-guide/overview.html
>

Yes, it's the same tutorial that we have in docs. The idea is to add new
feature on zf2-tutorial and update the docs consequently

> I can add Console support to the tutorial and tutorial app.
>

Right now we are focusing on the base components but I think Console is
a good idea for an "advanced" scenario.


--
Enrico Zimuel
Senior PHP Engineer     | [hidden email]
Zend Framework Team     | http://framework.zend.com
Zend Technologies Ltd.
http://www.zend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Artur Bodera
On Wed, Aug 8, 2012 at 11:22 AM, Enrico Zimuel <[hidden email]> wrote:
> I can add Console support to the tutorial and tutorial app.
>
Right now we are focusing on the base components but I think Console is
a good idea for an "advanced" scenario.

It is a base component :-)

It could be one of later chapters, but of course, the choice is yours.

Don't forget to update docs to mention this repository and to update repository readme.md to point
to the docs on  http://zf2.readthedocs.org/en/latest/user-guide/overview.html 

-- 
      __
     /.)\   +48 695 600 936
     \(./   [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: zf2-tutorial

Walter Tamboer
In reply to this post by Enrico Zimuel-2
I think it's best to create an example website (e.g. a company's website) that could actually exist. It should contain common use cases.


How to: Add an RSS feed to your website.
How to: Add an ATOM feed to your website.

How to: Build a contact form.
How to: Show the latest news on the front page.
How to: Create an overview with your company's employees.
How to: ... etc ...


I'm not sure if this tutorial is focused on creating a simple application or if it's meant to create bigger applications that require more advanced architectures? Depending on that I think it's most important to use the ServiceManager and/or Di components consequently.



How to: Access the service manager from within a form.
How to: Pass the service manager to a service layer.
How to: How to name your services (dots vs underscores, should your services be prefixed by your app's name, etc.)
How to: ... etc ...


All those common things that are dead simple but take forever to figure out if you're new to the framework. I think people need to be guided on best practices.


Regards,


Walter


> Date: Wed, 8 Aug 2012 10:49:26 +0200

> From: [hidden email]
> To: [hidden email]
> Subject: [zf-contributors] zf2-tutorial
>
> Hi all,
>
> as you know we forked the zf2-tutorial application of Rob Allen
> (akrabat) in our official repository:
> https://github.com/zendframework/zf2-tutorial/.
> The idea is to provide an example of how to build a simple web
> application using the MVC of ZF2 and the most common components, like
> Zend\Db.
>
> The zf2-tutorial application is a simple CRUD that uses a MySQL
> database. It shows how to implement a Module in ZF2 and how to use the
> Zend\Db to interact with a simple table.
> The idea is to use this application as example and explain the details
> in the "Getting started" section of the Programmer’s Reference of ZF2:
> http://zf2.readthedocs.org/en/latest/user-guide/overview.html
>
> Yesterday I sent a PR to the zf2-tutorial repository adding the language
> select box on the header page:
> https://github.com/zendframework/zf2-tutorial/pull/1
>
> With this PR we can show how to implement a simple language button to
> switch the language on the fly. I used the Zend\Session to store the
> language chosen. The internationalization support was already
> implemented using the Zend\I18n component.
>
> The idea is to add other features to the zf2-tutorial application.
> Because this is a tutorial application I think we need to show how to
> use the most common ZF2 components such as:
> - Zend\Paginator
> - Zend\Navigation
> - Zend\Form (using annotation)
> - View helper (creation/registration)
>
> I'm working on the Zend\Paginator and Zend\Navigation.
>
> Other ideas, feedbacks, comments?
>
>
> --
> Enrico Zimuel
> Senior PHP Engineer | [hidden email]
> Zend Framework Team | http://framework.zend.com
> Zend Technologies Ltd.
> http://www.zend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

mubarig
This post has NOT been accepted by the mailing list yet.
In reply to this post by Enrico Zimuel-2
That is very good idea.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Tomáš Fejfar
In reply to this post by Walter Tamboer
We (me and Martin Hujer) used a simple Blog application (https://github.com/mhujer/zf2demo) to show zf2 features for our ZF meetups in Prague (http://srazy.info/prvni-zf-meetup-praha/2341). It worked quite well. It's easy to understand and it may have all the important parts:

- db access to get articles
--- with nontrivial database (article, author, tags, comments)
- paginator for paginating the articles
- form for comment form
- authentication, authorization for admin section
- RSS generation

And is easily extensible with features:

- view helper to create links from http://* in coments
- view helper to list tags
- translation
- different date formating based on locale
- ...

I'd favor it over a company website as it's easily understandable and it's also something nearly everyone wrote in his life. 

On Wed, Aug 8, 2012 at 11:42 AM, Walter Tamboer <[hidden email]> wrote:
I think it's best to create an example website (e.g. a company's website) that could actually exist. It should contain common use cases.


How to: Add an RSS feed to your website.
How to: Add an ATOM feed to your website.

How to: Build a contact form.
How to: Show the latest news on the front page.
How to: Create an overview with your company's employees.
How to: ... etc ...


I'm not sure if this tutorial is focused on creating a simple application or if it's meant to create bigger applications that require more advanced architectures? Depending on that I think it's most important to use the ServiceManager and/or Di components consequently.



How to: Access the service manager from within a form.
How to: Pass the service manager to a service layer.
How to: How to name your services (dots vs underscores, should your services be prefixed by your app's name, etc.)
How to: ... etc ...


All those common things that are dead simple but take forever to figure out if you're new to the framework. I think people need to be guided on best practices.


Regards,


Walter


> Date: Wed, 8 Aug 2012 10:49:26 +0200
> From: [hidden email]
> To: [hidden email]
> Subject: [zf-contributors] zf2-tutorial

>
> Hi all,
>
> as you know we forked the zf2-tutorial application of Rob Allen
> (akrabat) in our official repository:
> https://github.com/zendframework/zf2-tutorial/.
> The idea is to provide an example of how to build a simple web
> application using the MVC of ZF2 and the most common components, like
> Zend\Db.
>
> The zf2-tutorial application is a simple CRUD that uses a MySQL
> database. It shows how to implement a Module in ZF2 and how to use the
> Zend\Db to interact with a simple table.
> The idea is to use this application as example and explain the details
> in the "Getting started" section of the Programmer’s Reference of ZF2:
> http://zf2.readthedocs.org/en/latest/user-guide/overview.html
>
> Yesterday I sent a PR to the zf2-tutorial repository adding the language
> select box on the header page:
> https://github.com/zendframework/zf2-tutorial/pull/1
>
> With this PR we can show how to implement a simple language button to
> switch the language on the fly. I used the Zend\Session to store the
> language chosen. The internationalization support was already
> implemented using the Zend\I18n component.
>
> The idea is to add other features to the zf2-tutorial application.
> Because this is a tutorial application I think we need to show how to
> use the most common ZF2 components such as:
> - Zend\Paginator
> - Zend\Navigation
> - Zend\Form (using annotation)
> - View helper (creation/registration)
>
> I'm working on the Zend\Paginator and Zend\Navigation.
>
> Other ideas, feedbacks, comments?
>
>
> --
> Enrico Zimuel
> Senior PHP Engineer | [hidden email]
> Zend Framework Team | http://framework.zend.com
> Zend Technologies Ltd.
> http://www.zend.com

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Enrico Zimuel-2
In reply to this post by Walter Tamboer
On 08/08/2012 11:42 AM, Walter Tamboer wrote:

>
> I'm not sure if this tutorial is focused on creating a simple application or if it's meant to create bigger applications that require more advanced architectures? Depending on that I think it's most important to use the ServiceManager and/or Di components consequently.
>
>
The idea of zf2-tutorial is to present a first example of application
built with ZF2. That means show as to use the MVC and introduce the
usage of some most common component such Zend\Db and Zend\Form.

We started using the zf2-tutorial proposed by Rob Allen and I think we
can continue on that, we have already the application and the document
in place. In my opinion we should just add some code showing the usage
of other components like the ones that I mentioned in my previous email.

I don't like the idea to present a bigger application as first tutorial
to discuss in the reference guide but I like very much the idea to offer
other demo applications.

We can create a dedicated repository or website to collect all these
demo applications with different use cases for ZF2.
What do you think? I think people will enjoy this a lot.

>
> How to: Access the service manager from within a form.
> How to: Pass the service manager to a service layer.
> How to: How to name your services (dots vs underscores, should your services be prefixed by your app's name, etc.)
> How to: ... etc ...
>
>
> All those common things that are dead simple but take forever to figure out if you're new to the framework. I think people need to be guided on best practices.
>
>
> Regards,
>
>
> Walter
>
>> Date: Wed, 8 Aug 2012 10:49:26 +0200
>> From: [hidden email]
>> To: [hidden email]
>> Subject: [zf-contributors] zf2-tutorial
>>
>> Hi all,
>>
>> as you know we forked the zf2-tutorial application of Rob Allen
>> (akrabat) in our official repository:
>> https://github.com/zendframework/zf2-tutorial/.
>> The idea is to provide an example of how to build a simple web
>> application using the MVC of ZF2 and the most common components, like
>> Zend\Db.
>>
>> The zf2-tutorial application is a simple CRUD that uses a MySQL
>> database. It shows how to implement a Module in ZF2 and how to use the
>> Zend\Db to interact with a simple table.
>> The idea is to use this application as example and explain the details
>> in the "Getting started" section of the Programmer’s Reference of ZF2:
>> http://zf2.readthedocs.org/en/latest/user-guide/overview.html
>>
>> Yesterday I sent a PR to the zf2-tutorial repository adding the language
>> select box on the header page:
>> https://github.com/zendframework/zf2-tutorial/pull/1
>>
>> With this PR we can show how to implement a simple language button to
>> switch the language on the fly. I used the Zend\Session to store the
>> language chosen. The internationalization support was already
>> implemented using the Zend\I18n component.
>>
>> The idea is to add other features to the zf2-tutorial application.
>> Because this is a tutorial application I think we need to show how to
>> use the most common ZF2 components such as:
>> - Zend\Paginator
>> - Zend\Navigation
>> - Zend\Form (using annotation)
>> - View helper (creation/registration)
>>
>> I'm working on the Zend\Paginator and Zend\Navigation.
>>
>> Other ideas, feedbacks, comments?
>>
>>
>> --
>> Enrico Zimuel
>> Senior PHP Engineer     | [hidden email]
>> Zend Framework Team     | http://framework.zend.com
>> Zend Technologies Ltd.
>> http://www.zend.com
>      
>


--
Enrico Zimuel
Senior PHP Engineer     | [hidden email]
Zend Framework Team     | http://framework.zend.com
Zend Technologies Ltd.
http://www.zend.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

jeremiah
This post has NOT been accepted by the mailing list yet.
In reply to this post by Walter Tamboer
On Aug 8, 2012, at 2:43 AM, Walter Tamboer [via Zend Framework Community] wrote:

I think it's best to create an example website (e.g. a company's website) that could actually exist. It should contain common use cases.


How to: Add an RSS feed to your website.
How to: Add an ATOM feed to your website.

How to: Build a contact form.
How to: Show the latest news on the front page.
How to: Create an overview with your company's employees.
How to: ... etc ...

I'd be careful about assuming that a "company website" is the right example to build out. Seems like doing this right would be too specific an implementation, and it's not likely to be the most interesting. I like the Album premise that is used in the existing Akrabat tutorial. I think picking use cases that illustrate data-driven apps, and assume that the users must be authenticated is right. Using ZF2 for anonymous company websites is fine, but it seems much more likely that it will be interesting for authenticated data-driven apps.


I'm not sure if this tutorial is focused on creating a simple application or if it's meant to create bigger applications that require more advanced architectures? Depending on that I think it's most important to use the ServiceManager and/or Di components consequently.

I wonder if the ServiceManager and Di are really to be considered "advanced".  Aren't they absolutely fundamental to understand?  I'd also suggest EventManager and Composer are new and fundamental. I think a nice simple and well documented example showing how these new and important features work is critical.

With regard to Di, maybe I just haven't found it yet, so forgive me if this is already created in the documentation, but when I was figuring out how to configure my first custom classes for Di, I really struggled to find the right combination of config array and alias. Once you grok how this works it's so easy and powerful, but it can be very hard to guess the right syntax for the module config.

I'm sure it will be a challenge to organize the right demos that strike the right balance of simplicity and thoroughness.

Jeremiah
rb
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

rb
This post has NOT been accepted by the mailing list yet.
This post was updated on .
In reply to this post by Enrico Zimuel-2
Hi,

It would be interesting to strengthen the model. I have had problems creating the table album in a particular scheme in postgres. ZF2 showed errors that could not access the table:

SQLSTATE[42P01]: Undefined table: 7 ERROR:  no existe la relación «zf2tutorial.album»
LINE 1: SELECT "zf2tutorial.album".* FROM "zf2tutorial.album"

Many applications have the data separated by schemas. How ZF2 support it?    

Other need I have respect the model is the call to stored procedures.

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: zf2-tutorial

jeremiah
This post has NOT been accepted by the mailing list yet.
In reply to this post by Walter Tamboer
Walter Tamboer wrote
I think it's best to create an example website (e.g. a company's website) that could actually exist. It should contain common use cases.


How to: Add an RSS feed to your website.
How to: Add an ATOM feed to your website.

How to: Build a contact form.
How to: Show the latest news on the front page.
How to: Create an overview with your company's employees.
How to: ... etc ...
I'd be careful about assuming that a "company website" is the right example to build out. Seems like doing this right would be too specific an implementation, and it's not likely to be the most interesting. I like the Album premise that is used in the existing Akrabat tutorial. I think picking use cases that illustrate data-driven apps, and assume that the users must be authenticated is right. Using ZF2 for anonymous company websites is fine, but it seems much more likely that it will be interesting for authenticated data-driven apps.


Walter Tamboer wrote
I'm not sure if this tutorial is focused on creating a simple application or if it's meant to create bigger applications that require more advanced architectures? Depending on that I think it's most important to use the ServiceManager and/or Di components consequently.
I wonder if the ServiceManager and Di are really to be considered "advanced".  Aren't they absolutely fundamental to understand?  I'd also suggest EventManager and Composer are new and fundamental. I think a nice simple and well documented example showing how these new and important features work is critical.

With regard to Di, maybe I just haven't found it yet, so forgive me if this is already created in the documentation, but when I was figuring out how to configure my first custom classes for Di, I really struggled to find the right combination of config array and alias. Once you grok how this works it's so easy and powerful, but it can be very hard to guess the right syntax for the module config.

I'm sure it will be a challenge to organize the right demos that strike the right balance of simplicity and thoroughness.

Jeremiah
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

Francis Drouillard
This post has NOT been accepted by the mailing list yet.
In reply to this post by Enrico Zimuel-2
Enrico Zimuel-2 wrote
as you know we forked the zf2-tutorial application of Rob Allen
[snip]
The idea is to provide an example of how to build a simple web
application using the MVC of ZF2 and the most common components, like
Zend\Db.
[snip]
Other ideas, feedbacks, comments?
--
Enrico Zimuel
I want to learn to create a website like the one linked to by Tomáš Fejfar, namely:
(http://srazy.info/prvni-zf-meetup-praha/2341).

The blog application made available by Tomáš Fejfar and Martin Hujer is now up and running on my local server. How would one go about adding Google Maps to that blog app, as well as a feature to add new articles? Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: zf2-tutorial

JulianoMeinen
This post has NOT been accepted by the mailing list yet.
In reply to this post by rb
Hi rb.

You can use "TableIdentifier" in "Module.php". Try this:

public function getServiceConfig()
    {
    return array(
    'factories' => array(
    'Album\Model\AlbumTable' =>  function($sm) {
    $tableGateway = $sm->get('AlbumTableGateway');
    $table = new AlbumTable($tableGateway);
    return $table;
    },
    'AlbumTableGateway' => function ($sm) {
    $dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
    $resultSetPrototype = new ResultSet();
    $resultSetPrototype->setArrayObjectPrototype(new Album());
    $PostgresTable = new TableIdentifier("album","album");
    return new TableGateway($PostgresTable, $dbAdapter, null, $resultSetPrototype);
    },
    ),
    );
    }

=/
Loading...