dynamically added title howto - codeigniter

I am using the excellent phil sturgeon template library, however I was wondering how do I assign dynamically any headings or titles to any part of my partials? Like I have a sidebar that has a login form. if Login is successful, I would like the heading that says for example 'Login' to say 'Welcome' if login is successful without creating a partial of just the h2 tags. But as a side note I noticed that the userguide of the template library doesn't mention the append_css and append_js functions at all? I saw this in someone's sample code and was wondering why that is?
Thanks anyway for all the support!

you can use functions *prepend_metadata()* or *append_metadata* in the controller and then echo $template['metadata'] in the view

Related

Cannot view joomla component

I've created a joomla component which consists of a html form, and when I try and browse to it:
index.php?option=com_helloworld
I get an error 404, component cannot be found.
I'm following this tutuorial:
http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2.5/Developing_a_Basic_Component
Can anyone please tell me how I can browse to the page?
UPDATE: here is the link to my sample component, its a basic html form.
http://tinyurl.com/d6tj7rz
Many thanks
IIRC, even if a component is not installed correctly, you can still access the code if it's on the server, from my experience. But that may have been a 1.5 thing.
If you don't specify a view in the URL by passing &view=viewname, AND you haven't set a default fallback view, then you can't expect to have anything come up.
For a good example on how to set a default view, look in components/com_contact/controller.php line 38.
Within the main controller's display method:
// Set the default view name and format from the Request.
$vName = $this->input->get('view', 'categories');
$this->input->set('view', $vName);

How we create custom sigup page in phpfox?

PHPfox providing the feature to create custom page from back-end but How can I call register form to custom page? Please provide suggestion.
Thanks in advance.
You can call template files within your own pages. I wrote a demo module that illustrates this, using this you can include the templates that display the form to sign up.
But is there any reason why you wouldn't want to use a custom template (instead of the default one) or CSS for the changes you need?

Single URL for all the navigations in asp.net mvc3

I have a requirement of having the same URL throughout the application navigations. Like below
http://www.[Site Name]:com. (Here User should not have the idea of chaning the URL from one page to another page)
I am using ASP.NET MVC3 with latest Razor View Engine,
Can some body give suggestions on this?
Advanced Thanks,
Satish Kotha
This may make it very difficult for users to access your site - they won't be able to bookmark a specific page, for example.
It sounds like you want a single-page-app (e.g. like Google Mail or Reader). In this case, you have one page and make heavy use of AJAX. You can query the server via javascript, and send back Partial Views, or raw data in JSON format which can be rendered on the client, possibly via some kind of templating engine.
As Graham Clark has already mentioned, this functionality will most likely be frustrating for the user; however, achieving it depends on the complexity of your project. You may want to look into using jquery to load partial views into the main content area of your site.
When you click on your navigation you can use jquery's load() to replace the main content on the page. Jquery-load-with-mvc-2-partialviews is an interesting blog post that may give you more insight into what you would want to do. Your code to load content could look something like this:
$("#mainContent").load("/Controller/Action",
{parameter}, function () {
// perform javascript actions on load complete
});

codeigniter embedded web page

I was wondering what is the best way to have a web page inside another page in code igniter. From the old code i'm redesigning they use iframes. Is this the best way to do it? I want to click on a button on the existing webpage, after it will do some query's and update a corresponding iframe below.
Thanks,
Tariq
This is ok to do in code igniter or any other web framework for that matter. This is more of an html question than it is a backend question. Happy Coding!

Twitter like Form Submission using Ajax or Jquery

I need a simple example of form submission very similar to Twitter.
How you type in a comment and click update and without the whole page refreshing, the comment gets added below on top of the rest of the comments.
I would prefer something in Jquery as my PHP project is already integrated with it.
See this pleae.
I wrote an example a while ago that more-or-less covers that. Getting data from a form is basic DOM, and you'll want to switch out the GET to POST since you are sending data rather then just requesting it.
I found these links for you:
jQuery plugin: Simplest Twitter-like dynamic character count for textareas and input fields
http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas
Or maybe
http://www.ajaxupdates.com/twitter-like-search-with-jquery-and-ajax/

Resources