The Artima Developer Community
Sponsored Link

PHP Buzz Forum
New 'default_action' Attribute for Modules

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Forum One

Posts: 118
Nickname: forumone
Registered: Sep, 2004

Forum One is consulting firm specializing in helping non-profits improve their online presence.
New 'default_action' Attribute for Modules Posted: Dec 22, 2004 12:10 PM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Forum One.
Original Post: New 'default_action' Attribute for Modules
Feed Title: Syntax Framework
Feed URL: http://blog.syntaxcms.org/rss.php?version=0.91
Feed Description: Finally, a place to answer Syntax questions
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Forum One
Latest Posts From Syntax Framework

Advertisement

Has this ever happened to you?

You're coding along, and you need to reference a module. You remember you called it 'calendar'. You know modules are references with URLs that begin with /content/, so you put in a link to /content/calendar/, and you test the link only to find it barf horribly.

Oh, that's right, you forgot to specify a default path in path_rewrites.conf.php...so mnemonically named, how could you forget!

Well, fret no more, dear developer. I too was annoyed by this and did something about it. Now you just need to have a new module attribute that you add when you're configuring the module in user.conf.php, where all the other module-related config stuff lives. Just add the line Modules::setAttribute('my_module_name', 'default_action', 'my_default_action'); and you're good to go.

But what if, in the heat of development, you forget? Well, since the code generators and example modules in Syntax CMS tend to assume that your default action is going to be called "list" anyway, it will try that. If that fails, you'll get the same old ugly screen you would have gotten otherwise.

The other good news is that there is now one less configuration file for you to worry about, as path_rewrites.conf.php is now history.

All this will be included in the 1.2.0 release, and is in CVS now.

Read: New 'default_action' Attribute for Modules

Topic: Character Type Functions Previous Topic   Next Topic Topic: Scope in PHP

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use