Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about a FAQ as the last chapter? #154

Open
markch123 opened this issue Nov 17, 2016 · 11 comments
Open

How about a FAQ as the last chapter? #154

markch123 opened this issue Nov 17, 2016 · 11 comments

Comments

@markch123
Copy link
Contributor

markch123 commented Nov 17, 2016

I quite like FAQs even if they are a bit antiquated :) And from the perspective of a lazy contributor its pretty easy to spend 5-10 minutes adding a question/answer to a list

Maybe its an idea to simply edit this comment with the list ? Rather then adding to the bottom of the thread and starting discussions on particular questions. Also another suggestion could be that each answer should be shortish 1/2 sentences and then a link to the official Yii2 guide (or cookbook!). If there is a better answer in SO then maybe the user guide should be updated or extended :)

The list of course could potentially get huge so at some stage would need to split into categories. But for now maybe just keep it simple. Actually maybe its just easier to start now and follow the Yii guide chapter structure :)

Application Structure
Where do I add js scripts
Handling Requests
How to extend controllers ?
How to dynamically add fields to form with validation ?
Key Concepts
Working with Databases

How do I add SQL functions such as now() into a ActiveRecord save operation.
Getting Data from Users
Displaying Data
Security
Caching
RESTful Web Services
Development Tools

Why composer returns error about bower
Testing
I want to integrate Yii2 into a CI. Do you have an examples using Jenkins or Travis
Special Topics
Does Yii2 have any performance metrics
Does yii2 support php7
I want to use Yii2 but my boss wants to know if it supports large sites, do you have any examples
Can I run Yii2 on HHVM
Widgets
How to properly refresh GridView in nested pjax component
How to remove label on radioList
How to change template on checkbox field
Whats a good example of a form password pattern
Is there a AJAX component
Helpers
How do I send mail

@samdark
Copy link
Owner

samdark commented Nov 17, 2016

Let's do FAQ session right here and see where it leads to. Ask anything.

@antonmarin
Copy link

Is any example of layered architecture? Or something like

@samdark
Copy link
Owner

samdark commented Nov 17, 2016

Is any example of layered architecture? Or something like

In general, it's out of scope of the framework and would look exactly the same no matter which framework is used. Many examples could be found searching for DDD.

@antonmarin
Copy link

antonmarin commented Nov 17, 2016

Seems like there is no questions ))

@bizley
Copy link

bizley commented Nov 17, 2016

It would be great to have something like that on the new Yii 2 website where you can add / edit questions and answers. StackOverflow is one of the main sources of perfect FAQ examples - countless times I've answered questions like "how to remove label on radioList?", "how to change template on checkbox field?", "why composer returns error about bower?" and so on...

@samdark
Copy link
Owner

samdark commented Nov 17, 2016

We could just link to SO :)

@bizley
Copy link

bizley commented Nov 17, 2016

True 😄 but not every question there can be answered in 1-2 sentences.

@nkostadinov
Copy link

I have some questions/issues which I had workaround for now, but if you could give me a better way to do it would be nice:

  1. How to extend controllers ?
  2. How to dynamically add fields to form with validation ?
  3. How to properly refresh GridView in nested pjax component ?

@samdark
Copy link
Owner

samdark commented Nov 17, 2016

  1. How to extend controllers ?

BController extends AController? Same as any other PHP class.

  1. How to dynamically add fields to form with validation ?

https://github.com/samdark/yii2-cookbook/blob/master/book/forms-activeform-js.md#adding-and-removing-fields-dynamically

  1. How to properly refresh GridView in nested pjax component ?

What's "nested pjax component"?

@nkostadinov
Copy link

  1. Seems obvious but the problem is that the action you want to override returns already rendered string. So you cannot do anything from there on e.g. add/modify variables sent to view, render other view etc
  2. 10x for that :)
  3. Sorry about that - I tested it now and now it works, may be it was an old issue. By nested pjax I mean
<?php \yii\widgets\Pjax::begin() ?>
<h2>Nested pjax</h2>
<div>
    <?php \yii\widgets\Pjax::begin() ?>
    <?= \yii\grid\GridView::widget([...]) ?>
    <?php \yii\widgets\Pjax::end() ?>
</div>
<?php \yii\widgets\Pjax::end() ?>

@samdark
Copy link
Owner

samdark commented Nov 17, 2016

  1. Seems obvious but the problem is that the action you want to override returns already rendered string. > So you cannot do anything from there on e.g. add/modify variables sent to view, render other view etc

If you need to override controller action, most probably, you're on a wrong way to a huge architectural mess. Extract contents of controller into domain layer, and call it from different controller actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants