Multiple content tags in Open Social applications

<?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs title="Another Multiple Views Example"> <Require feature="opensocial-0.8"/> </ModulePrefs> <Content type="html" view="home"><![CDATA[ <h1>Home</h1> ]]></Content> <Content type="html" view="profile"><![CDATA[ <h1>Profile</h1> ]]></Content> <Content type="html" view="canvas"><![CDATA[ <h1>Canvas</h1> ]]></Content> <Content type="html" view="canvas,profile"><![CDATA[ I am in both the canvas and profile view but, NOT in the home view. ]]></Content> <Content type="html"><![CDATA[ I am in any view that is […]
Continue reading…

Enjoyed this post? Share it!

 
 

Multiple views in Open Social applications

<?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs title="Multiple Views Example"> <Require feature="opensocial-0.8"/> </ModulePrefs> <Content type="html" view="profile"><![CDATA[ <h1>Profile Content</h1> ]]></Content> <Content type="html" view="canvas"><![CDATA[ <h1>Canvas Content</h1> ]]></Content> </Module> Other Combinations: <Content views="canvas, home"> This means the contained content will be displayed for both ‘‘canvas’’ and ‘‘home’’ views. <Content> This will be the default content displayed for all views not […]
Continue reading…

Enjoyed this post? Share it!

 
 

Using loops to display array data in codeigniter views

In this example we will see how to use loops to display multidimensional data in codeigniter views. Controller: <?php class SimpleController extends Controller { function index() { $data[’my_list’] = array("do this", "clean up", "do that"); $this->load->view(’index’, $data); } } ?> Index view: <html> <head> <title>display array data</title> </head> <body> <h1>Display array data</h1> <?php foreach($my_list as […]
Continue reading…

Enjoyed this post? Share it!

 
 

Loading multiple views with codeigniter

We can load multiple views similar to the way we load a single view in codeigniter. All the calls to the $this->load->view method are appended together before rendering. Example: function somecontrollerfunction() { $data[’pagetitle’] = "Welcome to w3mentor.com"; $this->load->view(’pageheader’, $data); $this->load->view(’pagenav’); $this->load->view(’pagecontent’); $this->load->view(’pagefooter’); }
Continue reading…

Enjoyed this post? Share it!

 
 

ERROR 1142 (42000): SHOW VIEW command denied to user ‘test’@’localhost’ for table ‘system’

This error(ERROR 1142 (42000): SHOW VIEW command denied to user ‘test’@’localhost’ for table ‘system’) occurs when users donot have sufficient privileges to view the syntax of a view definition. The view could have been created using the SQL SECURITY INVOKER clause. A root user will not get this error. Error occurs when this statement is […]
Continue reading…

Enjoyed this post? Share it!

 
 

ERROR 1356 (HY000): View ‘viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

This MySql (error ERROR 1356 (HY000): View ‘viewname’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them) occurs when a user tries to read data from a view that has been protected using the SQL SECURITY INVOKER clause while creating the view. Creating view using the SQL SECURITY […]
Continue reading…

Enjoyed this post? Share it!

 
 

SQL SECURITY INVOKER clause in MySql

The SQL SECURITY INVOKER clause is used to control access to data, generally in a view. Using the SQL SECURITY INVOKER clause will enforce rules that the user must have permissions to also see the underlying data. Creating view using the SQL SECURITY INVOKER clause. CREATE SQL SECURITY INVOKER VIEW system_users AS SELECT host,USER,password FROM […]
Continue reading…

Enjoyed this post? Share it!

 
 

CREATE VIEW privilege in MySql

In the MySql security model, the ability to create views requires a greater privilege than normally provided to create tables. Create user and grant privileges: CREATE USER test@localhost IDENTIFIED BY ‘test123’; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON products.* TO test@localhost; Running the following command will error out since the CREATE VIEW privilege is not given to the user. […]
Continue reading…

Enjoyed this post? Share it!

 
 

Explicitly return a view name other than default

The name of the view is specified explicitly in the example below. The ASP.NET MVC framework determines the name of the view from the name of the action if it is not mentioned. using System.Web.Mvc; namespace MvcApplication1.Controllers { public class ProductsController : Controller { public ActionResult Details() { return View("ProductDetails); } } } In this […]
Continue reading…

Enjoyed this post? Share it!

 
 

Return a View Result in ASP.NET MVC

A ViewResult is the most common ActionResult returned by a controller action. A ViewResult in ASP.NET MVC represents a view. ViewResult is returned when you want to return HTML to the browser. Example: using System.Web.Mvc; namespace MvcApplication1.Controllers { public class ProductsController : Controller { public ActionResult Index() { return View(); } } } The view […]
Continue reading…

Enjoyed this post? Share it!

 
 

Learn Codeigniter PHP Framework : Part 6 – Codeigniter views

Views are HTML files that can contain PHP code generally. They are loaded by $this->load->view(‘viewname’, $data). Views are loaded and used in the same function in a controller. The view is written in HTML. The PHP code is included within tags as with any HTML file. It is saved as a .php file in the […]
Continue reading…

Enjoyed this post? Share it!