levelx.me

  • Home
  • Design
    • 3D
    • Art
    • Freebies
    • Inspiration
    • Interior Design
    • Photography
    • Tutorials
    • Typography
  • Technology
    • Benchmarks
    • How To
    • News
    • Programming
    • Reviews
    • SAP BASIS
  • Lifestyle
    • Do it Yourself
    • Entertainment
    • Quotes
    • Self Improvement
    • Sports
  • Resources
    • Infographics
    • Themes
    • Tools
    • Wallpapers
  • ETC
    • places
    • Uncategorized
  • Android
    • How To
    • News
  • Apple
    • How To
    • News
  • Symfony Admin Generator Calling Actions with Custom Parameters

    Digg Digg

    The administration module actions can receive custom parameters using the query_string argument in a link_to() helper. For example, to extend the previous _edit_header partial with a link to the comments for the article, write this:

    It filters the comments to display only the ones related to $article. Using the query_string argument, you can specify a sorting order and/or a filter to display a custom list view. This can also be useful for custom interactions.

    Override index function

    public function executeIndex(sfWebRequest $request)
    {
    // For filter.. This code was missing in symfony documentation.
    if ($request->getParameter('filter'))
    {
    $this->setFilters($request->getParameter('project_filters'));
    }
    //-----------------
    // sorting
    if ($request->getParameter('sort'))
    {
    $this->setSort(array($request->getParameter('sort'), $request->getParameter('sort_type')));
    }
    // pager
    if ($request->getParameter('page'))
    {
    $this->setPage($request->getParameter('page'));
    }
    $this->pager = $this->getPager();
    $this->sort = $this->getSort();
    }
    

    You should read

    • Symfony 1.4 – Doctrine and Multiple Database Connections
    • Fixing IE7 dropping PHP Sessions
    • How Can Dawkins Explain the Perfect Eye in Our Brains?
    • Basic Guide: How to Install WordPress on Localhost
    • Skype For Android – finally Released

    Posted by Faizan on: September 1st, 2009 | Posted in: Programming

    8 Responses to “Symfony Admin Generator Calling Actions with Custom Parameters”

    B@D on September 1st, 2009 at 9:08 PM

    Wasn’t this a general Technology blog ?

    admin on September 1st, 2009 at 9:11 PM

    @B@D
    When it was, No one bothered to post :D

    B@D on September 1st, 2009 at 9:20 PM

    It needs Time & Research to Post something Original. ;-)

    Faizan on September 1st, 2009 at 9:28 PM

    Find me this post anywhere on World Wide Web (www) and I’ll stop blogging :P

    It took me whole day just to figure out how to make this thing work.

    And If you cant understand what is this Just leave it. People who know symfony know the worth of this code snippet :D

    sT*rchi1Ð on September 2nd, 2009 at 11:51 PM

    Faizan :

    Find me this post anywhere on World Wide Web (www) and I’ll stop blogging :P

    It took me whole day just to figure out how to make this thing work.

    And If you cant understand what is this Just leave it. People who know symfony know the worth of this code snippet :D

    exactly, btw wht is it? :D

    B@D on September 4th, 2009 at 3:51 PM

    I love symfony.
    Thanks! Great help.

    Faizan on September 4th, 2009 at 6:07 PM

    @sT*rchi1Ð
    Thanks you got my point :P and this is not for you.

    @B@D
    Thanks for appreciation :P btw I know what you mean by this :D

    jarod.chiang on December 1st, 2009 at 2:55 PM

    My Solution is:
    1.
    This article has
    getNbComments().’ comments’, ‘comment/list’, array(‘query_string’ => ‘filter=filter&filters[article_id]=’.$article->getId())) ?> comments.
    2.
    add a function called list in apps/MyApp/modules/commnent
    ==============================================================
    class comment extends autoComment {
    public function executeList(sfWebRequest $request)
    {
    if ($request->hasParameter(‘filter’))
    {
    $this->setFilters($request->getParameter(‘filters’));
    }
    $this->redirect(‘@comment’);
    }
    }
    ================================================================

    [refer to]
    http://www.symfony-project.org/book/1_2/14-Generators

    Leave a Reply


    Subscribe to Levelx

    Popular Posts

    • Create a jigsaw puzzle in adobe illustrator
    • At The Heart of The Image! – Nikon D5000 Review
    • Calibrating HTC Desire Battery
    • Typography Tips – With Amazing Examples
    • Famous Salvador Dali Paintings
    • Taking Screenshots on HTC Desire
    • Home Decoration and Interior Design 2011
    • Funny Road Signs (Part II)
    • Nokia Touch and Type X3-02 and C3-01: Review and Comparison
    • 3D Building Exterior Render – Design Workflow

    Recent Comments

    • Loading...

    Top Posts

    • FORMULA 1 - 2009 Season. (28)
    • Fixing IE7 dropping PHP Sessions (25)
    • M2N32 SLI-DLX WFI && RzR DeathADDER - - BURNT ! ! (17)
    • HTC Desire - Benchmark (17)
    • Home Decoration and Interior Design 2011 (17)
    • From Sand To Silicon: How A Intel CPU Is Built (16)
    • Windows 7 Theme - VEER II (16)
    • HTC Desire 2.10.405.2 OTA Update (16)
    • REQ: Stalker [ 1979 ] OST. (15)
    • Meet your DESIRE | HTC Desire Reviewed (15)

    Tags

    1TB android android 2.3 gingerbread android software apple art asus benchmark desire desktop eclair facebook Formula 1 froyo Gaming gingerbread google hacking htc HTC Desire infographic internet ios iPad iphone Islam lahore Lifestyle mobile new year Nexus one Nokia nvidia pakistan photography php psp Review s60 smart phones symbian symfony typography wallpapers web 2.0

    levelx.me is proudly powered by WordPress | Theme Designed by AF8AB