📜 ⬆️ ⬇️

Zend Framework's small features

I think it will be useful to those who are beginning to deal with ZF

Question answer:

1. I want to write normal names of action, for example MySuperCuperAction, gives an error.
To do this, url-e writes / mycontroller / my-super-cuper / or through current, the separator can be changed Zend_Controller_Dispatcher_Abstract-> setWordDelimiter
')
2. In models, you have to get an adapter to the base every time
do Zend_Db_Table_Abstract :: setDefaultAdapter ($ db) during initialization and forget about it in the models.

3. How to render in the Named Segments of the response object (Often used in layouts, for example, $ this-> layout () -> sidebar)
There are many ways
- in action-ah we write render ('MyActionName', 'MyNamedSegment'), thus the result of rendering the action MyActionName is written in MyNamedSegment, i.e. in layouts you can output $ this-> layout () -> MyNamedSegment
- add to the Response object $ response-> append ('MyNamedSegment', ' myContent ')

Source: https://habr.com/ru/post/46706/


All Articles