Part of the EllisLab Network
   
35 of 36
35
Matchbox 0.9.4
Posted: 03 June 2008 01:53 PM   [ Ignore ]   [ # 341 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  375
Joined  02-04-2008

Thanks Z.

Profile
 
 
Posted: 24 June 2008 11:26 AM   [ Ignore ]   [ # 342 ]  
Summer Student
Total Posts:  3
Joined  06-24-2008

Hi,

I’m sorry if this has been asked over the past 33 pages. But I was looking for a way to override some of the config, in this case, the main_url.  For instance, using the URI helper…

instead of

redirect ("module/controller/action")

i’d like to just have it

redirect("controller/action")

This may sound irrelevant. But it is, really. I wanted to duplicate a module under a new module name and without this, I will have to change all the lines which contains the url, ie, forms and redirections.

Need direction please.

Profile
 
 
Posted: 24 June 2008 01:03 PM   [ Ignore ]   [ # 343 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  491
Joined  06-16-2006

I’m not sure what you are asking. But if you simply wish to change some of the config values, just go ahead and fire up on of the config files and edit away! The base_url config item is located in config/config.php.

 Signature 

Best regards, Zacharias.
Matchbox - Modular Separation | Wick - Controller Loader

Profile
 
 
Posted: 24 June 2008 06:50 PM   [ Ignore ]   [ # 344 ]  
Summer Student
Total Posts:  3
Joined  06-24-2008

Hi Zacharias.

Actually, that’s not what I meant. I’m sorry if I was vague. Let me give an example.

For instance, we’re using th URL helper. On a typical non-modular codeigniter, to redirect to a page, you say,

redirect("controller/action")

... when we do this under a matchbox module, we say,..

redirect("module/controller/action")

... it picks up the base_url from the general config.php file then adds module/controller/action.

Now, what I kind of looking for is a way to work inside my module as if I do not know the name and/or directory name of the module. So that when I redirect inside my module, I will just instead say…

redirect("controller/action")

as if the module is independent.  This is important to me because there will be a case where I will just copy the entire module and rename as another module with the same function. It is easier to program a module as if it is independent. That’s why, I was think if somehow, for every module, there is a way to override some config on config.php for a particular module. For instance, if the config.php’s value for base_url is http://domain.com, do we have a way to change that value ONLY in a module and make it’s value http://domain.com/module instead? Or is there any solution?

Profile
 
 
Posted: 25 June 2008 12:16 PM   [ Ignore ]   [ # 345 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  491
Joined  06-16-2006

This is not something that I will be implementing in Matchbox natively. However, it certainly is possible to extend the the helper in order to do something like this. But I think the easiest thing to do is simply use

redirect($modulevariable.'controller/method')


And define the name of the module somewhere in the module so you only need to edit it once.

If you absolutely want to automate it by extending the helper, you’d have to use the following method inside the redirect function.

$this->matchbox->detect_caller()


which will return a string that is the name of the module that is calling the redirect method. However, you’ll need to add the filename of the helper to the callers array in the matchbox config file.

 Signature 

Best regards, Zacharias.
Matchbox - Modular Separation | Wick - Controller Loader

Profile
 
 
Posted: 25 June 2008 09:00 PM   [ Ignore ]   [ # 346 ]  
Summer Student
Total Posts:  3
Joined  06-24-2008

Thanks Zacharias.

How’s the load? Using matchbox, do you see some lag time?

Profile
 
 
Posted: 26 June 2008 05:42 AM   [ Ignore ]   [ # 347 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  491
Joined  06-16-2006

It’s certainly slower, since additional checks for file existance is made, along with some other calculations. However, I have yet to see any actual benchmarks, so I can’t say how much of a slow-down we’re talking.

 Signature 

Best regards, Zacharias.
Matchbox - Modular Separation | Wick - Controller Loader

Profile
 
 
Posted: 31 July 2008 04:22 PM   [ Ignore ]   [ # 348 ]  
Summer Student
Total Posts:  1
Joined  07-30-2008
PeteZahut - 09 May 2008 11:03 AM

I’m looking into Matchbox and it looks pretty good I must say! Got it setup and it seems to be working alright. There’s one thing I’m not sure about and that is if it’s possible to have like a ‘catch all’ module that needs no seperate segment.

For instance you have a blog, forum and basic pages. The url to the forum is http://www.something.com/forum/read/, to the blog is http://www.something.com/blog/read/, but there’s also http://www.something.com/ and http://www.something.com/basicpage/, where basicpage can be anything but leads to the module ‘site’ where the 1st segment is read and used as value. How can you do this without the need for adding ‘site’ to the url? (so to avoid http://www.something.com/site/basicpage/).

This is something that I would like to learn, too! I have been playing today with routes.php and Router.php but I haven’t found a solution for this one.

Profile
 
 
Posted: 22 August 2008 06:38 AM   [ Ignore ]   [ # 349 ]  
Grad Student
Avatar
Rank
Total Posts:  55
Joined  03-06-2007

I am using matchbox 0.9.4 with CI 1.6.3

I use a default layout.php file but have to place a copy in each modules/module_name/views or it cannot load the body view.

My structure is as follows:

application/modules/pages
application/modules/pages/controllers/pages.php
application/modules/pages/views/layout.php
application/modules/pages/views/homepage.php

application/views/layout.php

If I remove the modules/pages layout file I get an error message

“Unable to load the requested file: homepage.php”

Has anyone had this before.

 Signature 

NI Football

Profile
 
 
Posted: 22 August 2008 08:36 AM   [ Ignore ]   [ # 350 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  491
Joined  06-16-2006

I sent you an answer as a reply to your e-mail stb74. smile

 Signature 

Best regards, Zacharias.
Matchbox - Modular Separation | Wick - Controller Loader

Profile
 
 
   
35 of 36
35
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 62779 Total Logged-in Users: 31
Total Topics: 77459 Total Anonymous Users: 2
Total Replies: 418115 Total Guests: 220
Total Posts: 495574    
Members ( View Memberlist )