Magento --- development-acquisition and operation of controller and other data

Source: Internet
Author: User

In Controller
1
Obtain layout.
In Controller
$ This-> getlayout ()-> getblock ('head ')
That is:
Mage: getsingleton ('Core/layout ')-> getblock ('head ')

2
In controller:
$ This-> _ addcontent ($ this-> getlayout ()-> createblock ('blog/manage_blog_edit '))
Yes
$ This-> getlayout ()-> getblock ('content')-> append ($ this-> getlayout ()-> createblock ('blog/manage_blog_edit '));

$ This-> _ addcontent ($ this-> getlayout ()-> createblock ('blog/manage_blog_edit '))
-> _ Addleft ($ this-> getlayout ()-> createblock ('blog/manage_blog_edit_tabs '));

3
// Start painting Method
$ This-> loadlayout ();
// Draw the image.
$ This-> renderlayout ();
Redirection.
$ This-> _ redirect ('*/*/');

4
Obtain the information of the logged-in account.
Mage: getsingleton ('admin/session')-> getuser ()-> getfirstname ()
Mage: getsingleton ('admin/session')-> getuser ()-> getlastname ()

5
get the current category ---- mage_catalog_model_category
Mage: getsingleton ('catalog/lay')-> getcurrentcategory ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.